1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-17 07:52:42 +01:00
Commit Graph

25 Commits

Author SHA1 Message Date
Raymond Hill
62b6826dd5
Further modularize uBO's codebase
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1664

Modularization is a necessary step toward possibly publishing
a more complete nodejs package to allow using uBO's filtering
capabilities outside of the uBO extension.

Additionally, as per feedback, remove undue usage of console
output as per feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1664#issuecomment-888451032
2021-07-28 19:48:38 -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
7d90f97aa1
Enable the blocking of CSP reports by default
Related issue:
- https://github.com/LiCybora/NanoDefenderFirefox/issues/196
2020-12-11 12:34:09 -05:00
Raymond Hill
6d34a52179
fix #2859 2018-09-03 14:06:49 -04:00
Raymond Hill
3c85c03194
fix #308, #3436, https://github.com/uBlockOrigin/uBlock-issues/issues/155
<https://github.com/gorhill/uBlock/issues/3436>: a new per-site switch
has been added, no-scripting, which purpose is to wholly disable/enable
javascript for a given site. This new switch has precedence over all
other ways javascript can be disabled, including precedence over dynamic
filtering rules.

The popup panel will report the number of script resources which have
been seen by uBO for the current page. There is a minor inaccuracy to
be fixed regarding the count, and which fix requires to extend request
journaling.

<https://github.com/gorhill/uBlock/issues/308>: the `noscript` tags will
now be respected when the new no-scripting switch is in effect on a given
site.

A default setting has been added to the _Settings_ pane to
disable/enable globally the new no-script switch, such that one can
work in default-deny mode regarding javascript execution.

<https://github.com/uBlockOrigin/uBlock-issues/issues/155>: a new
hidden setting, `requestJournalProcessPeriod`, has been added to
allow controlling the delay before uBO internally process it's
network request journal queue. Default to 1000 (milliseconds).
2018-08-31 18:47:02 -04:00
Raymond Hill
7766786b2c
code review: reuse last decomposed hostname (hit rate = 75%) 2018-06-03 13:27:42 -04:00
Raymond Hill
588a8accb1
add default noop rules for behind-the-scene scope 2018-03-31 10:21:11 -04:00
Raymond Hill
b10ac0020d
make use of CodeMirror in "My rules" pane 2018-03-11 10:59:39 -04:00
gorhill
95b25f7d49
fix #3150 2017-10-19 09:35:28 -04:00
gorhill
0232382695
refactor static network filtering, add support for csp injection 2017-05-12 10:35:11 -04:00
gorhill
42afd0c3d0
code review: to/from punycode conversion only if needed 2017-05-03 19:43:09 -04:00
gorhill
8c352e1fac code review: do not test for ip address each time we broaden hostname 2016-11-12 13:42:36 -05:00
gorhill
89148351e8 #1163: this implements "block elements by size" 2016-01-17 13:30:43 -05:00
gorhill
ea49484dd3 this fixes #1067 + partially fixes #1070 2015-12-15 10:40:40 -05:00
gorhill
30039ff9c7 code review 2015-11-23 09:49:50 -05:00
gorhill
113c2e11a5 this (indirectly) fixes #15: let uBlock block remote fonts globally or on a site-basis 2015-06-10 09:23:48 -04:00
gorhill
bcbc06b2ff better reporting of switch events in the logger 2015-04-25 00:28:30 -04:00
gorhill
c8b8a2acd5 meh, changed my mind again 2015-04-11 08:54:22 -04:00
gorhill
d01a73e636 whitelisting must have precedence over strict blocking 2015-04-09 12:20:24 -04:00
gorhill
651c25c839 fixed popup blocker switch; added ability to manually edit switches 2015-04-09 11:19:31 -04:00
gorhill
637439c6db duh 2015-04-08 06:21:31 -04:00
gorhill
aa8b5850b8 code review 2015-04-07 13:27:46 -04:00
gorhill
c6668391e0 move branch toggling into switches manager 2015-04-07 13:24:15 -04:00
gorhill
2dde6f15de new switch: toggle cosmetic filtering on/off for a site 2015-04-05 12:03:14 -04:00
gorhill
f2ff0edfaf this fixes #1013, #1062 (draft) 2015-03-27 13:00:55 -04:00