chemicaljs 1.4.7 → 1.4.9
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 +5 -3
- package/client/chemical.js +4 -4
- package/examples/example/package-lock.json +8 -8
- package/examples/example/package.json +1 -1
- package/examples/example-components/package-lock.json +8 -8
- package/examples/example-components/package.json +1 -1
- package/examples/example-styled/package-lock.json +8 -8
- package/examples/example-styled/package.json +1 -1
- package/examples/example-vite/package-lock.json +8 -8
- package/examples/example-vite/package.json +1 -1
- package/package.json +3 -3
- package/update.bash +1 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ A example with the vite plugin can be found in [`/example-vite/`](https://github
|
|
|
9
9
|
|
|
10
10
|
A example with all the components can be found in [`/example-components/`](https://github.com/chemicaljs/chemical/tree/main/examples/example-components).
|
|
11
11
|
|
|
12
|
-
A real
|
|
12
|
+
A real world styled example can be found in [`/example-styled/`](https://github.com/chemicaljs/chemical/tree/main/examples/example-styled).
|
|
13
13
|
|
|
14
14
|
### Server
|
|
15
15
|
|
|
@@ -38,6 +38,8 @@ const chemical = new ChemicalServer({
|
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
`hostname_whitelist` overrides `hostname_blacklist` if you try to set them both.
|
|
42
|
+
|
|
41
43
|
3. Use `chemical.app` which is an express app. You may need to import express for certain APIs.
|
|
42
44
|
|
|
43
45
|
```js
|
|
@@ -84,13 +86,13 @@ In your project create a folder to store your static assets. Create an index.htm
|
|
|
84
86
|
If you want to set the wisp server to an external server just change the `wisp` attribute.
|
|
85
87
|
|
|
86
88
|
```html
|
|
87
|
-
<script wisp="wss://wisp.mercurywork.shop/" src="/chemical.js"></script>
|
|
89
|
+
<script data-wisp="wss://wisp.mercurywork.shop/" src="/chemical.js"></script>
|
|
88
90
|
```
|
|
89
91
|
|
|
90
92
|
If you want to set the transport just change the `transport` attribute. Choose `libcurl` (default becuase it supports Firefox) or `epoxy`.
|
|
91
93
|
|
|
92
94
|
```html
|
|
93
|
-
<script transport="epoxy" src="/chemical.js"></script>
|
|
95
|
+
<script data-transport="epoxy" src="/chemical.js"></script>
|
|
94
96
|
```
|
|
95
97
|
|
|
96
98
|
2. In a inline script or javascript file, encode a URL with Chemical using the async function `window.chemicalEncode`.
|
package/client/chemical.js
CHANGED
|
@@ -215,11 +215,11 @@ function getTransport(transport) {
|
|
|
215
215
|
|
|
216
216
|
let connection;
|
|
217
217
|
|
|
218
|
-
let wispURL = document.currentScript.
|
|
219
|
-
let transport = document.currentScript.
|
|
218
|
+
let wispURL = document.currentScript.dataset.wisp;
|
|
219
|
+
let transport = document.currentScript.dataset.transport;
|
|
220
220
|
|
|
221
|
-
async function chemicalTransport(transport, wisp) {
|
|
222
|
-
await connection.setTransport(getTransport(
|
|
221
|
+
async function chemicalTransport(newTransport = transport, wisp = wispURL) {
|
|
222
|
+
await connection.setTransport(getTransport(newTransport) || "/libcurl/index.mjs", [{ wisp: wisp || (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/" }]);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
async function registerSW() {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.4.
|
|
12
|
+
"chemicaljs": "^1.4.8",
|
|
13
13
|
"express": "^4.19.2"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -713,9 +713,9 @@
|
|
|
713
713
|
]
|
|
714
714
|
},
|
|
715
715
|
"node_modules/@titaniumnetwork-dev/ultraviolet": {
|
|
716
|
-
"version": "3.2.
|
|
717
|
-
"resolved": "https://registry.npmjs.org/@titaniumnetwork-dev/ultraviolet/-/ultraviolet-3.2.
|
|
718
|
-
"integrity": "sha512-
|
|
716
|
+
"version": "3.2.4",
|
|
717
|
+
"resolved": "https://registry.npmjs.org/@titaniumnetwork-dev/ultraviolet/-/ultraviolet-3.2.4.tgz",
|
|
718
|
+
"integrity": "sha512-vdYVDtk5n0bGOpcDFIUDyW/Nmlu7y5QToomed2Ewo1R9HwO6ewy3eTctpNKZJF0vv0XfGPrTWsozBU3rLX07Ng=="
|
|
719
719
|
},
|
|
720
720
|
"node_modules/@tootallnate/once": {
|
|
721
721
|
"version": "1.1.2",
|
|
@@ -1167,16 +1167,16 @@
|
|
|
1167
1167
|
}
|
|
1168
1168
|
},
|
|
1169
1169
|
"node_modules/chemicaljs": {
|
|
1170
|
-
"version": "1.4.
|
|
1171
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.
|
|
1172
|
-
"integrity": "sha512-
|
|
1170
|
+
"version": "1.4.8",
|
|
1171
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.8.tgz",
|
|
1172
|
+
"integrity": "sha512-2MVc7EbBjJIjDhaM87uSqPzOoPNZgmc5cOTf6jRceghKlB6GaxVUGc4DJjriy1nWFh929flkmpFchghhW5AZLQ==",
|
|
1173
1173
|
"dependencies": {
|
|
1174
1174
|
"@mercuryworkshop/bare-mux": "^2.0.2",
|
|
1175
1175
|
"@mercuryworkshop/epoxy-transport": "^2.1.3",
|
|
1176
1176
|
"@mercuryworkshop/libcurl-transport": "^1.3.6",
|
|
1177
1177
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1178
1178
|
"@mercuryworkshop/wisp-js": "^0.1.0",
|
|
1179
|
-
"@titaniumnetwork-dev/ultraviolet": "^3.2.
|
|
1179
|
+
"@titaniumnetwork-dev/ultraviolet": "^3.2.4",
|
|
1180
1180
|
"express": "^4.19.2",
|
|
1181
1181
|
"rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
|
|
1182
1182
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.4.
|
|
12
|
+
"chemicaljs": "^1.4.8",
|
|
13
13
|
"express": "^4.19.2"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -713,9 +713,9 @@
|
|
|
713
713
|
]
|
|
714
714
|
},
|
|
715
715
|
"node_modules/@titaniumnetwork-dev/ultraviolet": {
|
|
716
|
-
"version": "3.2.
|
|
717
|
-
"resolved": "https://registry.npmjs.org/@titaniumnetwork-dev/ultraviolet/-/ultraviolet-3.2.
|
|
718
|
-
"integrity": "sha512-
|
|
716
|
+
"version": "3.2.4",
|
|
717
|
+
"resolved": "https://registry.npmjs.org/@titaniumnetwork-dev/ultraviolet/-/ultraviolet-3.2.4.tgz",
|
|
718
|
+
"integrity": "sha512-vdYVDtk5n0bGOpcDFIUDyW/Nmlu7y5QToomed2Ewo1R9HwO6ewy3eTctpNKZJF0vv0XfGPrTWsozBU3rLX07Ng=="
|
|
719
719
|
},
|
|
720
720
|
"node_modules/@tootallnate/once": {
|
|
721
721
|
"version": "1.1.2",
|
|
@@ -1167,16 +1167,16 @@
|
|
|
1167
1167
|
}
|
|
1168
1168
|
},
|
|
1169
1169
|
"node_modules/chemicaljs": {
|
|
1170
|
-
"version": "1.4.
|
|
1171
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.
|
|
1172
|
-
"integrity": "sha512-
|
|
1170
|
+
"version": "1.4.8",
|
|
1171
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.8.tgz",
|
|
1172
|
+
"integrity": "sha512-2MVc7EbBjJIjDhaM87uSqPzOoPNZgmc5cOTf6jRceghKlB6GaxVUGc4DJjriy1nWFh929flkmpFchghhW5AZLQ==",
|
|
1173
1173
|
"dependencies": {
|
|
1174
1174
|
"@mercuryworkshop/bare-mux": "^2.0.2",
|
|
1175
1175
|
"@mercuryworkshop/epoxy-transport": "^2.1.3",
|
|
1176
1176
|
"@mercuryworkshop/libcurl-transport": "^1.3.6",
|
|
1177
1177
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1178
1178
|
"@mercuryworkshop/wisp-js": "^0.1.0",
|
|
1179
|
-
"@titaniumnetwork-dev/ultraviolet": "^3.2.
|
|
1179
|
+
"@titaniumnetwork-dev/ultraviolet": "^3.2.4",
|
|
1180
1180
|
"express": "^4.19.2",
|
|
1181
1181
|
"rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
|
|
1182
1182
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"chemicaljs": "^1.4.
|
|
12
|
+
"chemicaljs": "^1.4.8",
|
|
13
13
|
"express": "^4.19.2"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -713,9 +713,9 @@
|
|
|
713
713
|
]
|
|
714
714
|
},
|
|
715
715
|
"node_modules/@titaniumnetwork-dev/ultraviolet": {
|
|
716
|
-
"version": "3.2.
|
|
717
|
-
"resolved": "https://registry.npmjs.org/@titaniumnetwork-dev/ultraviolet/-/ultraviolet-3.2.
|
|
718
|
-
"integrity": "sha512-
|
|
716
|
+
"version": "3.2.4",
|
|
717
|
+
"resolved": "https://registry.npmjs.org/@titaniumnetwork-dev/ultraviolet/-/ultraviolet-3.2.4.tgz",
|
|
718
|
+
"integrity": "sha512-vdYVDtk5n0bGOpcDFIUDyW/Nmlu7y5QToomed2Ewo1R9HwO6ewy3eTctpNKZJF0vv0XfGPrTWsozBU3rLX07Ng=="
|
|
719
719
|
},
|
|
720
720
|
"node_modules/@tootallnate/once": {
|
|
721
721
|
"version": "1.1.2",
|
|
@@ -1167,16 +1167,16 @@
|
|
|
1167
1167
|
}
|
|
1168
1168
|
},
|
|
1169
1169
|
"node_modules/chemicaljs": {
|
|
1170
|
-
"version": "1.4.
|
|
1171
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.
|
|
1172
|
-
"integrity": "sha512-
|
|
1170
|
+
"version": "1.4.8",
|
|
1171
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.8.tgz",
|
|
1172
|
+
"integrity": "sha512-2MVc7EbBjJIjDhaM87uSqPzOoPNZgmc5cOTf6jRceghKlB6GaxVUGc4DJjriy1nWFh929flkmpFchghhW5AZLQ==",
|
|
1173
1173
|
"dependencies": {
|
|
1174
1174
|
"@mercuryworkshop/bare-mux": "^2.0.2",
|
|
1175
1175
|
"@mercuryworkshop/epoxy-transport": "^2.1.3",
|
|
1176
1176
|
"@mercuryworkshop/libcurl-transport": "^1.3.6",
|
|
1177
1177
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1178
1178
|
"@mercuryworkshop/wisp-js": "^0.1.0",
|
|
1179
|
-
"@titaniumnetwork-dev/ultraviolet": "^3.2.
|
|
1179
|
+
"@titaniumnetwork-dev/ultraviolet": "^3.2.4",
|
|
1180
1180
|
"express": "^4.19.2",
|
|
1181
1181
|
"rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
|
|
1182
1182
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"": {
|
|
7
7
|
"name": "chemical-example-vite",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"chemicaljs": "^1.4.
|
|
9
|
+
"chemicaljs": "^1.4.8",
|
|
10
10
|
"express": "^4.19.2",
|
|
11
11
|
"preact": "^10.22.1"
|
|
12
12
|
},
|
|
@@ -1175,9 +1175,9 @@
|
|
|
1175
1175
|
]
|
|
1176
1176
|
},
|
|
1177
1177
|
"node_modules/@titaniumnetwork-dev/ultraviolet": {
|
|
1178
|
-
"version": "3.2.
|
|
1179
|
-
"resolved": "https://registry.npmjs.org/@titaniumnetwork-dev/ultraviolet/-/ultraviolet-3.2.
|
|
1180
|
-
"integrity": "sha512-
|
|
1178
|
+
"version": "3.2.4",
|
|
1179
|
+
"resolved": "https://registry.npmjs.org/@titaniumnetwork-dev/ultraviolet/-/ultraviolet-3.2.4.tgz",
|
|
1180
|
+
"integrity": "sha512-vdYVDtk5n0bGOpcDFIUDyW/Nmlu7y5QToomed2Ewo1R9HwO6ewy3eTctpNKZJF0vv0XfGPrTWsozBU3rLX07Ng=="
|
|
1181
1181
|
},
|
|
1182
1182
|
"node_modules/@tootallnate/once": {
|
|
1183
1183
|
"version": "1.1.2",
|
|
@@ -1730,16 +1730,16 @@
|
|
|
1730
1730
|
}
|
|
1731
1731
|
},
|
|
1732
1732
|
"node_modules/chemicaljs": {
|
|
1733
|
-
"version": "1.4.
|
|
1734
|
-
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.
|
|
1735
|
-
"integrity": "sha512-
|
|
1733
|
+
"version": "1.4.8",
|
|
1734
|
+
"resolved": "https://registry.npmjs.org/chemicaljs/-/chemicaljs-1.4.8.tgz",
|
|
1735
|
+
"integrity": "sha512-2MVc7EbBjJIjDhaM87uSqPzOoPNZgmc5cOTf6jRceghKlB6GaxVUGc4DJjriy1nWFh929flkmpFchghhW5AZLQ==",
|
|
1736
1736
|
"dependencies": {
|
|
1737
1737
|
"@mercuryworkshop/bare-mux": "^2.0.2",
|
|
1738
1738
|
"@mercuryworkshop/epoxy-transport": "^2.1.3",
|
|
1739
1739
|
"@mercuryworkshop/libcurl-transport": "^1.3.6",
|
|
1740
1740
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
1741
1741
|
"@mercuryworkshop/wisp-js": "^0.1.0",
|
|
1742
|
-
"@titaniumnetwork-dev/ultraviolet": "^3.2.
|
|
1742
|
+
"@titaniumnetwork-dev/ultraviolet": "^3.2.4",
|
|
1743
1743
|
"express": "^4.19.2",
|
|
1744
1744
|
"rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
|
|
1745
1745
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chemicaljs",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "Easily create your own web proxy with no experience required.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"@mercuryworkshop/epoxy-transport": "^2.1.3",
|
|
16
16
|
"@mercuryworkshop/libcurl-transport": "^1.3.6",
|
|
17
17
|
"@mercuryworkshop/scramjet": "^1.0.2",
|
|
18
|
-
"@mercuryworkshop/wisp-js": "^0.1.
|
|
19
|
-
"@titaniumnetwork-dev/ultraviolet": "^3.2.
|
|
18
|
+
"@mercuryworkshop/wisp-js": "^0.1.1",
|
|
19
|
+
"@titaniumnetwork-dev/ultraviolet": "^3.2.4",
|
|
20
20
|
"express": "^4.19.2",
|
|
21
21
|
"rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
|
|
22
22
|
}
|
package/update.bash
CHANGED