Commit Graph

8959 Commits

Author SHA1 Message Date
Raymond Hill e1222d1643
Use `require` instead of `fs`
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1664#issuecomment-888332409
2021-07-28 10:38:24 -04:00
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
Raymond Hill 193cbac43e
Make Firefox dev build auto-update 2021-07-26 08:40:46 -04:00
Raymond Hill 3ba1fe05eb
New revision for dev build 2021-07-26 08:36:00 -04:00
Raymond Hill f392d09a13
Fix broken the compiling of generic cosmetic exception filters
Related issue:
- https://github.com/uBlockOrigin/uAssets/pull/9637

Regression from
- https://github.com/gorhill/uBlock/commit/c25938f
2021-07-26 08:34:32 -04:00
Raymond Hill 89064478dd
Modernize code: URLSearchParams() API support is now widespread 2021-07-25 07:08:03 -04:00
Raymond Hill bf7b0702e4
Make Firefox dev build auto-update 2021-07-24 07:56:34 -04:00
Raymond Hill 8d270cf6e6
New revision for dev build 2021-07-24 07:48:20 -04:00
Raymond Hill c25938f5bc
Ensure compiled sections are ordered in ascending id
Related issue:
- https://www.reddit.com/r/uBlockOrigin/comments/oq6kt5/ubo_loads_generic_filter_instead_of_specific/h6a4nca/
2021-07-24 07:44:26 -04:00
Raymond Hill 2035475371
Make Firefox dev build auto-update 2021-07-23 10:35:48 -04:00
Raymond Hill 0fcb3cee37
New revision for dev build 2021-07-23 10:13:11 -04:00
Raymond Hill 51d14de44a
Fix handling of some procedural cosmetic filters with explicit `:scope`
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1011#issuecomment-884806241
2021-07-23 10:11:07 -04:00
Raymond Hill 63c5bd34dc
Simplify maintenance 2021-07-23 09:04:59 -04:00
Raymond Hill c893f76c12
Fix broken test 2021-07-23 08:51:06 -04:00
Raymond Hill 22284e5ff6
Use `#?#` form to make the test page compatible with other blockers 2021-07-23 08:43:49 -04:00
Raymond Hill 31e0ea1e83
Add more procedural cosmetic filter cases
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1011#issuecomment-884806241
2021-07-23 08:39:23 -04:00
Raymond Hill d5ced9bced
New revision for stable release 2021-07-23 07:38:44 -04:00
Raymond Hill 7645189386
Import translation work from https://crowdin.com/project/ublock 2021-07-22 09:44:41 -04:00
Raymond Hill cd237ed3e1
Fix rendering of punycoded hostname in popup panel
Regression from:
- 75deadd31e
2021-07-20 11:22:33 -04:00
Raymond Hill 0c66680a2c
Make Firefox dev build auto-update 2021-07-20 08:51:17 -04:00
Raymond Hill d4b1b8467b
Import translation work from https://crowdin.com/project/ublock 2021-07-20 08:45:27 -04:00
Raymond Hill d46f93a5a0
New revision for release candidate 2021-07-20 08:42:26 -04:00
Raymond Hill 75deadd31e
Provide visual cue in popup panel when base domain has subdomains
Related issue:
- https://github.com/gorhill/uBlock/issues/284
2021-07-20 08:37:05 -04:00
Raymond Hill dcc72ba51c
Make Firefox dev build auto-update 2021-07-19 11:46:40 -04:00
Raymond Hill 525aceb34d
New revision for release candidate 2021-07-19 11:39:16 -04:00
Raymond Hill aff6a2fa05
Import translation work from https://crowdin.com/project/ublock 2021-07-19 11:38:31 -04:00
Raymond Hill f51106014b
Import translation work from https://crowdin.com/project/ublock 2021-07-19 11:36:38 -04:00
Raymond Hill 448a9a52f6
Better using present tense...? 2021-07-19 11:32:43 -04:00
Raymond Hill c9710ac9d1
Better deal with no-longer-existing ports
Disconnected ports could still happen Even when the port
was still seen as valid internally. Using a try-catch
block makes invalid port detection more reliable. This
is an occurrence I often encountered when stepping into
content script code, causing suprious error messages to
be thrown into uBO's background dev console.
2021-07-19 11:25:52 -04:00
Raymond Hill efca367694
Make Firefox dev build auto-update 2021-07-18 10:21:22 -04:00
Raymond Hill 9e87c0170d
New revision for dev build 2021-07-18 10:15:07 -04:00
Raymond Hill 3c5c085ded
Import translation work from https://crowdin.com/project/ublock 2021-07-18 10:14:40 -04:00
Raymond Hill 1d27138da9
Disclose where uBO's own filter lists are hosted 2021-07-18 10:10:17 -04:00
Raymond Hill 4fe8126c66
Add ability to match against script content of data: URI
Related commit:
- ebc42ae21e
2021-07-18 08:50:57 -04:00
Raymond Hill 9c8691709d
Make Firefox dev build auto-update 2021-07-17 14:30:44 -04:00
Raymond Hill 5c0d8fb848
New revision for dev build 2021-07-17 14:28:03 -04:00
Raymond Hill f07b1475a3
Fix hasty last commit 2021-07-17 14:27:37 -04:00
Raymond Hill 36f82b8a5a
Make Firefox dev build auto-update 2021-07-17 14:16:01 -04:00
Raymond Hill fa4aee70ce
new revision for dev build 2021-07-17 14:09:56 -04:00
Raymond Hill ebc42ae21e
Add abort-current-script scriptlet
This scriplet supersedes abort-current-inline-script (acis),
and accepts an optional third argument which is matched
against the `src` property of script resources.

When the third argument is not provided, the scriptlet
behaves essentially the same as `acis`, and because of
this `acis` is now aliased to `abort-current-script`, and
all existing `acis` filters will execute with no change
in behavior.

In the long run, usage of `abort-current-inline-script` or
its alias `acis` should go away and be replaced with
`abort-current-script` or its alias `acs`.
2021-07-17 14:03:50 -04:00
Raymond Hill 11e6ff5782
Make Firefox dev build auto-update 2021-07-17 12:25:59 -04:00
Raymond Hill 79f123d0c8
New revision for dev build 2021-07-17 12:21:58 -04:00
Raymond Hill 5120aac6ad
Import translation work from https://crowdin.com/project/ublock 2021-07-17 12:21:09 -04:00
Raymond Hill e85c6f2d3e
Merge background changes to user filters in "My filters" pane
Related issue:
- https://github.com/gorhill/uBlock/issues/3704
2021-07-17 12:03:56 -04:00
Raymond Hill b7d41ec85a
Make Firefox dev build auto-update 2021-07-16 14:10:56 -04:00
Raymond Hill 5cdf414558
New revision for dev build 2021-07-16 14:07:38 -04:00
Raymond Hill e3f8a612f4
Minor code review 2021-07-16 14:06:59 -04:00
Raymond Hill bad1506f20
Move chromium-specific code path to chromium directory 2021-07-16 10:29:39 -04:00
Raymond Hill a4aced69dc
Reorganize platform directory to avoid Chromium-centric appearance
Though Firefox shares a lot of WebExtensions code with Chromium,
these platforms have their own specific code paths, for various
reasons.

The reorganization here makes it clear that Chromium platform is
just one flavor of WebExtensions, and as such all Chromium-specific
code paths should no longer be automatically pulled by other
platforms where these code paths are not needed.

Given that the filepath of many files changed, here is the
parent commit to quickly browse back to the previous directory
layout:

ec7db30b2f
2021-07-16 10:06:58 -04:00
Raymond Hill ec7db30b2f
Simplify fetching title of tabs
The title of tabs in uBO is solely to have a better
presentation in the logger -- no other purpose.

This commit simplify keeping track of the titles, from
an active approach by directly querying it from tabs
whenever a change occurs, to a passive approach by
storing it when the title string become available in
some tab event handlers.
2021-07-16 08:59:30 -04:00