Skip to content

Latest commit

 

History

History
42 lines (24 loc) · 3.13 KB

uBlock.md

File metadata and controls

42 lines (24 loc) · 3.13 KB

Embedding and Building uBlock

The uBlock extension is embedded into Windscribe as if the extension was a normal uBlock build. All the regular uBlock build files and assets are placed into the distributed assets as they would normally appear in an official uBlock build.

The main differences are that the popup.html, background.html and manifest.json are removed entirely.

All assets that are loaded from the removed background.html, must be copied over to the windscribe version of background.html, and any content script or permissions defined in the uBlock manifest.json must also be accounted for in the Windscribe manifest.json. While the removal of the uBlock versions are handled at build time by the /modules/ext/scripts/ublock/pull-ublock.js script, making sure we are loading the correct assets in background.html is done manually.

The version of uBlock that is built and embedded is defined in /modules/ext/package.json. The uBlockVersion field is the branch name that is cloned, built and bundled into the extension.

We maintain a fork of uBlock on github, but try to keep the changes to a minimum so that there is less work to keep in sync with upstream changes.

https://github.com/Windscribe/uBlock

Updating uBlock

The current convention is to download the latest tagged release of uBlock from the original github repo: https://github.com/gorhill/uBlock and drop it into a branch in our fork, naming the branch after the uBlock version, i.e. ws-v1.40.4

The key changes that are required as of v1.40.4 are:

It is possible that future uBlock version will have many more breaking changes, especially when uBlock moves to manifest v3, so looking through the uBlock changelog is important prior to updating.

Once the new branch has been pushed to github, update the uBlockVersion field in /modules/ext/package.json

IMPORTANT make sure to delete the local /public/ublock directory after updating the uBlockVersion field.

Some post update validation

  • Are blocklists being respected
  • Does toggling blocklists still work. Use µBlock.availableFilterLists or µBlock.selectedFilterLists in background console to validate.
  • Does the windscribe extension icon change upon activating DOM/Network level blocks
  • Are all lists returned by the Windscribe API being fetched when inspecting the Network tab in developer console
  • When enabling Advanced mode, does the uBlock Setting/Options UI work
  • General developer console errors or warnings