diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..2f69791e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,33 @@ +# v1.0.1 + +In your `sw.js` script, you MUST import `uv.bundle.js` then `uv.config.js` in order. This is because we can no longer hard-code the paths. Ideally, we would import `uv.config.js` then use the config.bundle path in the serviceworker, however the config is dependant on `uv.bundle.js`, which we don't know the location to. + +Old: +```js +importScripts('./uv/uv.sw.js'); + +const sw = new UVServiceWorker(); + +self.addEventListener('fetch', event => + event.respondWith( + sw.fetch(event) + ) +); +``` + +New: +```diff ++ importScripts('./uv/uv.bundle.js'); ++ importScripts('./uv/uv.config.js'); +importScripts('./uv/uv.sw.js'); + +const sw = new UVServiceWorker(); + +self.addEventListener('fetch', event => + event.respondWith( + sw.fetch(event) + ) +); +``` + +You are still required to specify all paths in `uv.config.js`. \ No newline at end of file diff --git a/README.md b/README.md index ef2157a7..52e2a611 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Advanced web proxy used for evading internet censorship or accessing websites in Ultraviolet works by intercepting HTTP requests with a service worker script that follows the [TompHTTP specifications](https://github.com/tomphttp). +See the [changelog](./CHANGELOG.md). + ## How do I deploy/run this? This repository is the bare-bones of Ultraviolet. This only contains the source code required to compile `uv.bundle.js`. diff --git a/package-lock.json b/package-lock.json index ef84ad3c..20b8bea6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ultraviolet", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ultraviolet", - "version": "1.0.0", + "version": "1.0.1", "license": "ISC", "dependencies": { "bowser": "^2.11.0", diff --git a/package.json b/package.json index 63b752cd..78879e2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ultraviolet", - "version": "1.0.0", + "version": "1.0.1", "description": "Proxy", "main": "lib/index.js", "scripts": {