chemicaljs 1.0.2 → 1.0.4
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 +2 -2
- package/package.json +5 -5
- package/public/chemical.js +4 -6
- package/public/chemical.sw.js +3 -1
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
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chemicaljs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Create your own web proxy using Ultraviolet fast, easy, and no experience required.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"author": "Nebelung",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@mercuryworkshop/bare-mux": "^
|
|
15
|
-
"@mercuryworkshop/epoxy-transport": "^2.0
|
|
16
|
-
"@titaniumnetwork-dev/ultraviolet": "^3.
|
|
14
|
+
"@mercuryworkshop/bare-mux": "^2.0.0",
|
|
15
|
+
"@mercuryworkshop/epoxy-transport": "^2.1.0",
|
|
16
|
+
"@titaniumnetwork-dev/ultraviolet": "^3.2.0",
|
|
17
17
|
"express": "^4.19.2",
|
|
18
18
|
"wisp-server-node": "^1.1.0"
|
|
19
19
|
}
|
|
20
|
-
}
|
|
20
|
+
}
|
package/public/chemical.js
CHANGED
|
@@ -7,12 +7,11 @@ function chemicalEncode(url) {
|
|
|
7
7
|
let wispURL = document.currentScript.getAttribute("wisp");
|
|
8
8
|
|
|
9
9
|
async function registerSW() {
|
|
10
|
+
const connection = new window.BareMux.BareMuxConnection("/baremux/worker.js");
|
|
11
|
+
await connection.setTransport("/epoxy/module.js", [{ wisp: wispURL || (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/" }]);
|
|
12
|
+
|
|
10
13
|
if ("serviceWorker" in navigator) {
|
|
11
14
|
await navigator.serviceWorker.register("/chemical.sw.js");
|
|
12
|
-
|
|
13
|
-
await window.BareMux.SetTransport("EpxMod.EpoxyClient", {
|
|
14
|
-
wisp: wispURL || (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/",
|
|
15
|
-
});
|
|
16
15
|
} else {
|
|
17
16
|
console.error("Service worker failed to register.")
|
|
18
17
|
}
|
|
@@ -33,8 +32,7 @@ async function loadScript(src) {
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
(async () => {
|
|
36
|
-
await loadScript("/baremux/
|
|
37
|
-
await loadScript("/epoxy/index.js");
|
|
35
|
+
await loadScript("/baremux/index.js");
|
|
38
36
|
await loadScript("/uv/uv.bundle.js");
|
|
39
37
|
await loadScript("/uv/uv.config.js");
|
|
40
38
|
await registerSW();
|
package/public/chemical.sw.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
importScripts("/
|
|
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) => {
|