chemicaljs 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ import { ChemicalServer } from "chemicaljs";
19
19
  const chemical = new ChemicalServer();
20
20
  ```
21
21
 
22
- 3. Use `chemical.app` which is an express app. You may need to import express for certen APIs.
22
+ 3. Use `chemical.app` which is an express app. You may need to import express for certain APIs.
23
23
 
24
24
  ```js
25
25
  chemical.app.get("/", function(req, res){
@@ -109,4 +109,4 @@ Some features that may come in the future are:
109
109
  - Easy tab cloaking components.
110
110
 
111
111
  ## License
112
- Chemical Uses the MIT license.
112
+ Chemical Uses the MIT license.
package/index.js CHANGED
@@ -3,6 +3,7 @@ import { createServer } from "node:http";
3
3
  import express from "express";
4
4
  import wisp from "wisp-server-node";
5
5
  import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
6
+ import { libcurlPath } from "@mercuryworkshop/libcurl-transport";
6
7
  import { epoxyPath } from "@mercuryworkshop/epoxy-transport";
7
8
  import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
8
9
 
@@ -12,6 +13,7 @@ class ChemicalServer {
12
13
  this.app = express();
13
14
  this.app.use(express.static(resolve(import.meta.dirname, "public")));
14
15
  this.app.use("/baremux/", express.static(baremuxPath));
16
+ this.app.use("/libcurl/", express.static(libcurlPath));
15
17
  this.app.use("/epoxy/", express.static(epoxyPath));
16
18
  this.app.use("/uv/", express.static(uvPath));
17
19
  this.server.on("request", (req, res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chemicaljs",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Create your own web proxy using Ultraviolet fast, easy, and no experience required.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,8 +13,9 @@
13
13
  "dependencies": {
14
14
  "@mercuryworkshop/bare-mux": "^1.1.4",
15
15
  "@mercuryworkshop/epoxy-transport": "^2.0.6",
16
+ "@mercuryworkshop/libcurl-transport": "^1.3.2",
16
17
  "@titaniumnetwork-dev/ultraviolet": "^3.1.5",
17
18
  "express": "^4.19.2",
18
19
  "wisp-server-node": "^1.1.0"
19
20
  }
20
- }
21
+ }
@@ -10,7 +10,7 @@ async function registerSW() {
10
10
  if ("serviceWorker" in navigator) {
11
11
  await navigator.serviceWorker.register("/chemical.sw.js");
12
12
 
13
- await window.BareMux.SetTransport("EpxMod.EpoxyClient", {
13
+ await window.BareMux.SetTransport("CurlMod.LibcurlClient", {
14
14
  wisp: wispURL || (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/",
15
15
  });
16
16
  } else {
@@ -34,6 +34,7 @@ async function loadScript(src) {
34
34
 
35
35
  (async () => {
36
36
  await loadScript("/baremux/bare.cjs");
37
+ await loadScript("/libcurl/index.js");
37
38
  await loadScript("/epoxy/index.js");
38
39
  await loadScript("/uv/uv.bundle.js");
39
40
  await loadScript("/uv/uv.config.js");
@@ -1,8 +1,10 @@
1
- importScripts("/epoxy/index.js");
1
+ importScripts("/libcurl/index.js");
2
2
  importScripts("/uv/uv.bundle.js");
3
3
  importScripts("/uv/uv.config.js");
4
4
  importScripts(__uv$config.sw || "/uv/uv.sw.js");
5
5
 
6
+ Object.defineProperty(self, "crossOriginIsolated", { value: true }); // Firefox fix
7
+
6
8
  const uv = new UVServiceWorker();
7
9
 
8
10
  self.addEventListener("fetch", (event) => {