1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-04 18:19:38 +02:00
uBlock/dist
Raymond Hill 22022f636f
Modularize codebase with export/import
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1664

The changes are enough to fulfill the related issue.

A new platform has been added in order to allow for building
a NodeJS package. From the root of the project:

    ./tools/make-nodejs

This will create new uBlock0.nodejs directory in the
./dist/build directory, which is a valid NodeJS package.

From the root of the package, you can try:

    node test

This will instantiate a static network filtering engine,
populated by easylist and easyprivacy, which can be used
to match network requests by filling the appropriate
filtering context object.

The test.js file contains code which is typical example
of usage of the package.

Limitations: the NodeJS package can't execute the WASM
versions of the code since the WASM module requires the
use of fetch(), which is not available in NodeJS.

This is a first pass at modularizing the codebase, and
while at it a number of opportunistic small rewrites
have also been made.

This commit requires the minimum supported version for
Chromium and Firefox be raised to 61 and 60 respectively.
2021-07-27 17:26:04 -04:00
..
chromium Use version number in the filename of packages 2018-12-23 10:16:08 -05:00
description Import translation work from https://crowdin.com/project/ublock 2021-02-04 06:55:25 -05:00
firefox Modularize codebase with export/import 2021-07-27 17:26:04 -04:00
README.md uBlock for firefox legacy is auto-updating (#3774) 2020-09-01 16:19:21 -04:00
version Modularize codebase with export/import 2021-07-27 17:26:04 -04:00

INSTALL

Chromium

  • Download and unzip ublock0.chromium.zip (latest release desirable).
  • Rename the unzipped directory to ublock
    • When you later update manually, replace the content of the ublock folder with the content of the latest zipped version.
    • This will ensure that all the extension settings will be preserved
    • As long as the extension loads from same folder path from which it was originally installed, all your settings will be preserved.
  • Go to chromium/chrome Extensions.
  • Click to check Developer mode.
  • Click Load unpacked extension....
  • In the file selector dialog:
    • Select the directory ublock which was created above.
    • Click Open.

The extension will now be available in your chromium/chromium-based browser.

Remember that you have to update manually also. For some users, updating manually is actually an advantage because:

  • You can update when you want
  • If ever a new version sucks, you can easily just re-install the previous one

Firefox

Compatible with Firefox 52 and beyond.

For stable release version

This works only if you set xpinstall.signatures.required to false in about:config.see "Add-on signing in Firefox"

  • Download ublock0.firefox.xpi (latest release desirable).
    • Right-click and choose "Save As...".
  • Drag and drop the previously downloaded ublock0.firefox.xpi into Firefox

For beta version

Location of uBO settings

On Linux, the settings are saved in a JSON file located at ~/.mozilla/firefox/[profile name]/browser-extension-data/uBlock0@raymondhill.net/storage.js.

When you uninstall the extension, Firefox deletes that file, so all your settings are lost when you uninstall.

Firefox legacy

Compatible with Firefox 24-56, Pale Moon and SeaMonkey.

  • Download ublock0.firefox-legacy.xpi (latest release desirable).
    • Right-click and select "Save Link As..."
  • Drag and drop the previously downloaded ublock0.firefox-legacy.xpi into Firefox

With Firefox 43 and beyond, you may need to toggle the setting xpinstall.signatures.required to false in about:config.see "Add-on signing in Firefox"

Your uBlock Origin settings are kept intact even after you uninstall the addon.

On Linux, the settings are saved in a SQlite file located at ~/.mozilla/firefox/[profile name]/extension-data/ublock0.sqlite.

On Windows, the settings are saved in a SQlite file located at %APPDATA%\Mozilla\Firefox\Profiles\[profile name]\extension-data\ublock0.sqlite.

Build instructions (for developers)

  • Clone uBlock and uAssets repositories in the same parent directory
    • git clone https://github.com/gorhill/uBlock.git
    • git clone https://github.com/uBlockOrigin/uAssets.git
  • Set path to uBlock: cd uBlock
  • The official version of uBO is in the master branch
    • git checkout master
  • Build the plugin:
    • Chromium: ./tools/make-chromium.sh
    • Firefox webext: ./tools/make-firefox.sh all
    • Firefox legacy:
      • git checkout firefox-legacy
      • ./tools/make-firefox-legacy.sh all
  • Load the result of the build into your browser:
    • Chromium: load the unpacked extension folder /uBlock/dist/build/uBlock0.chromium/ in Chromium to use the extension.
    • Firefox: drag-and-drop /uBlock/dist/build/uBlock0.firefox.xpi or /uBlock/dist/build/uBlock0.firefox-legacy.xpi into Firefox.