1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-19 09:22:40 +02:00
Commit Graph

3948 Commits

Author SHA1 Message Date
Raymond Hill
ce0bdb4369
More CSS fine tuning
Additionally, have a list of preset colors for the color
picker (unlike Firefox, Chromium's built-in color picker
does not have a list of preset colors by default).
2022-02-05 07:42:17 -05:00
Raymond Hill
ed25ed6a6c
Fix selection color in codemirror editor
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/1963#discussioncomment-2113694
2022-02-04 18:31:00 -05:00
Raymond Hill
35490439b9
Fix cname-related ink in logger
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/1963#discussioncomment-2112321
2022-02-04 12:41:50 -05:00
Raymond Hill
dbf4ed7f4b
Fix grab area of element picker to accomodate dark theme 2022-02-04 09:25:50 -05:00
Raymond Hill
020dad8e58
Fix case of unthemed background in logger
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/1963#discussioncomment-2110873
2022-02-04 08:24:24 -05:00
Raymond Hill
e434142d52
Import translation work from https://crowdin.com/project/ublock 2022-02-04 07:41:20 -05:00
Raymond Hill
1e81e2f751
More fine-tuning of default theme
Bring default color theme more in line with previous
versions.

Additionally, use `button` tags for navigation bar tabs,
as per MDN guidelines:

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#interactive_content
2022-02-03 16:24:48 -05:00
Raymond Hill
c65f896a2a
Propagate upward accent color stylesheet only when it changes 2022-02-03 09:34:33 -05:00
Raymond Hill
3b350cc844
Limit saturation of accent color for button surface 2022-02-03 08:56:08 -05:00
Raymond Hill
efec9aa69e
Fix color of cnamed entries in overview pane
Additionally, remove pointless (hsluv -> rgb -> hsluv) conversion
when computing accent color-based stylsheet.
2022-02-03 07:12:15 -05:00
Raymond Hill
795bf07fd7
Import translation work from https://crowdin.com/project/ublock 2022-02-03 06:20:12 -05:00
Raymond Hill
3e3d1e26be
Store non-normalized accent color
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1957

Normalize color only at stylesheet build time, and cache
generated stylesheet for future reuse.
2022-02-03 06:14:04 -05:00
Raymond Hill
c38682221c
Reduce background color flash through usage of prefers-color-scheme
uBO will use the information from prefers-color-scheme to reduce
likelihood of background color flash. However this works only for
when prefers-color-scheme is properly set by the browser, and only
when uBO's theme selection is "auto", or when it happens to
match that of prefers-color-scheme.

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1284
2022-02-02 18:38:28 -05:00
Raymond Hill
c61fe6a72b
Fix typo in code re. preferred theme colors 2022-02-02 17:00:38 -05:00
q1800
88d465fdd0
Correct GitHub link for HSLuv author (#3863)
I believe this was an error. Just submitted PR to correct error.
2022-02-02 16:30:14 -05:00
Raymond Hill
ecb73d2ff5
Bring dark theme out of experimental status
Too many changes to list here, essentially there is now a
user interface setting to enable/disable dark theme, and
I've rearranged a bit the Settings pane as a result and
also altered other visuals in various places.

There are places which I know have not been thoroughly
tested (i.e. logger inspector).

Will fine-tune as per feedback.

Issues with the classic popup panel will not be addressed,
and if feedback is that it has become unusuable, it will be
outright removed.
2022-02-02 15:40:47 -05:00
Raymond Hill
2bc9c8aa38
Added i18n strings related to theme stuff 2022-02-02 15:00:29 -05:00
Raymond Hill
14c8775ce3
Import translation work from https://crowdin.com/project/ublock 2022-02-02 14:53:38 -05:00
Raymond Hill
7b5e5b28c2
Import translation work from https://crowdin.com/project/ublock 2022-02-01 10:38:27 -05:00
Raymond Hill
39e1adfc2d
Mark revert/commit buttons as disabled by default
Related feedback:
- 4ee8a5948d (commitcomment-65716257)
2022-01-31 16:14:56 -05:00
Raymond Hill
e64dacebce
Add ability to see troubleshooting info in report page
Additionally, further fine-tune colors.
2022-01-31 13:28:43 -05:00
Raymond Hill
7b29c7ef3e
Import translation work from https://crowdin.com/project/ublock 2022-01-31 09:53:04 -05:00
Raymond Hill
e110cce92a
Fine tune rule colors
Use explicit color values, as alpha-merging does not guarantee
uniform lightness.
2022-01-31 09:10:20 -05:00
Raymond Hill
819279d99d
More fine-tuning following CSS changes 2022-01-30 20:13:31 -05:00
Raymond Hill
f8c6be868c
Fine tune lightness (Luv) of rule colors in light theme
Trying to use same Luv for both light and dark theme does not
really work -- best to have each them have their own Luv for
rule colors.
2022-01-30 19:39:18 -05:00
Raymond Hill
4ee8a5948d
Work toward bringing dark theme closer to a stable release
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/401
2022-01-30 18:35:26 -05:00
Raymond Hill
e8bfc9a031
Add canrunads.js as redirectable resource
Related discussion:
- 036e13101e (commitcomment-65068100)
2022-01-29 08:40:47 -05:00
Raymond Hill
b4911e2d7c
Raise minimum versions of browsers
For the following reasons:

- Support for CSS `gap`, so as to remove the need to
  fall back onto classic popup panel, and thus making
  it possible to fully remove long-ago deprecated
  classic panel (announced in 1.27.0)[1]:
  https://developer.mozilla.org/en-US/docs/Web/CSS/gap

- Support for dynamic import:
  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

Firefox's minimum version is raised to 68 because it's
the oldest ESR version supporting the features above.
From now on, minimum version of Firefox will always be
an ESR one.

---

[1] https://github.com/gorhill/uBlock/releases/tag/1.27.0
2022-01-28 12:02:56 -05:00
Raymond Hill
f98b70d1c0
Improve dealing with ambiguity in regex-based-looking network filters
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1932

Reported in point 3 under "Actual behavior".
2022-01-28 11:18:40 -05:00
Raymond Hill
a5ca565e9c
Add hashComponents() to FingerprintJS v3 shim
Related feedback:
- f4824bd0d9 (commitcomment-64534458)
2022-01-28 09:26:57 -05:00
Raymond Hill
fba680f9ab
Improve google-analytics shim
Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/11456
2022-01-24 12:26:24 -05:00
Raymond Hill
250cf96aae
Fix regression causing regex-based filters to be case sensitive
Related feedback:
- https://github.com/AdguardTeam/AdguardFilters/issues/88067#issuecomment-1019518277

Regression commit:
- 725e6931f5
2022-01-23 12:32:11 -05:00
Raymond Hill
f4824bd0d9
Add shim for FingerprintJS (aka Fingerprint v3)
Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/11408
2022-01-21 08:38:48 -05:00
Raymond Hill
3537e9d3c0
Disable the suspending of network requests when installing the extension
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/s7c9go/page_automatically_refreshes_after_installation/
2022-01-19 09:16:01 -05:00
Raymond Hill
d53f2362b1
Fix regression in reporting of header= option in logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1932

Related commit:
- 725e6931f5
2022-01-18 10:47:39 -05:00
Raymond Hill
de0f6a2cdd
Add longest wait time when fetching from storage in support info
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1865

This may be useful to rule out that the issue is caused by the
browser API responding in unduly delayed manner.
2022-01-14 09:07:28 -05:00
Raymond Hill
9759bfef4e
Fix edge case of background image filter and no cosmetic filters
Related commit:
- ebaa8a8bb2

Related feedback:
- ebaa8a8bb2 (commitcomment-63818019)
2022-01-13 11:03:21 -05:00
Raymond Hill
ebaa8a8bb2
Do not select background images as best candidate in picker
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/s2lrm0/picker_cant_select_and_block_this/
2022-01-13 09:24:04 -05:00
Raymond Hill
2f0ad153dd
Add clarifying comment 2022-01-12 12:55:53 -05:00
Raymond Hill
5e44d6fd07
Import translation work from https://crowdin.com/project/ublock 2022-01-12 10:16:58 -05:00
Raymond Hill
7c8aec250f
Prevent highly generic cosmetic filters from affecting html/body elements
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1692
2022-01-12 10:11:49 -05:00
Raymond Hill
0bc0af9d8d
Add test to detect case of improper deserialization
Related commit:
- 8f461072f5
2022-01-12 09:03:38 -05:00
Raymond Hill
8f461072f5
Fix selfie with invalid data in some circumstances
Reported internally.

The issue involves `removeparam` filters with a regex value. When
such filter was visited before a selfie was created, this would cause
the created selfie to persist a RegExp object, which can't be
serialized. This would cause exceptions to be thrown when uBO would
be subsequently loaded with the tainted selfie, since uBO would try
to execute a plain Object as a RegExp.
2022-01-11 11:06:11 -05:00
Raymond Hill
9b22961291
Properly report user-filters in troubleshooting information
User filters are enabled by default, they should be reported
under the `listset` section, along with how many filters are
being enforced.
2022-01-11 07:55:37 -05:00
Raymond Hill
6941ec7fb0
Escape unescaped " in attribute values
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1923
2022-01-11 07:20:03 -05:00
Raymond Hill
9ee8e7b607
Improve element picker/zapper's handling of shadow roots
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1850
2022-01-07 08:54:23 -05:00
Raymond Hill
560c81a585
Import translation work from https://crowdin.com/project/ublock 2022-01-07 08:16:10 -05:00
Raymond Hill
b565d311a4
Fix CSS sizing of click-to-load widget as suggested
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1901
2022-01-07 08:02:31 -05:00
Raymond Hill
6d1b44b42c
Report only stats for eTLD+1 in troubleshooting information
Related commit:
- affdde02a9
2022-01-07 07:56:32 -05:00
Raymond Hill
affdde02a9
Add "blockedDetails" section to troubleshooting information
This will allow to find out what is specifically blocked on the
page reported as having issues, potentially saving time
when volunteers try to diagnose issues.
2022-01-07 07:32:54 -05:00
Raymond Hill
d2b4d5689c
Use "…" instead of "..."
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1918
2022-01-06 08:08:57 -05:00
Raymond Hill
6e807974bc
Import translation work from https://crowdin.com/project/ublock 2022-01-02 11:31:15 -05:00
Raymond Hill
6836d2b9ca
Fix bad detection of unnecessary trailing |
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/1916

Regression from:
- 3b7a265ee2
2022-01-02 11:13:21 -05:00
Raymond Hill
6364609ac7
Import translation work from https://crowdin.com/project/ublock 2022-01-01 11:11:58 -05:00
Raymond Hill
c9dbe43124
Import translation work from https://crowdin.com/project/ublock 2021-12-31 17:28:04 -05:00
Raymond Hill
c8c144b663
Also test legitimacy of popup tab against last clicked link
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1912

Related commit:
- 7713597e3e

In above related commit, uBO was modified to cache the URL of the
last clicked link, and to use this cached URL to test for the
legitimacy of the newly opened tab.

The current commit add back a test against the URL of the last
clicked link to avoid false positives when navigating from within
the newly opened tab.
2021-12-31 14:18:16 -05:00
Raymond Hill
925c8d5d0c
Add setting to control suspension on network activity at launch
Related discussion:
- a0a9497b4a (commitcomment-62560291)

The new setting, when disabled (enabled by default), allows a user
to prevent uBO from waiting for all filter lists to be loaded
before allowing network activity at launch. The setting is enabled
by default, meaning uBO waits for all filter lists to be loaded in
memory before unsuspending network activity. Some users may find
this behavior undesirable, hence the new setting.

This gives the option to potentially speed up page load at launch,
at the cost of potentially not properly filtering network requests
as per filter lists/rules.

For platforms not supporting the suspension of network activity,
the setting will merely prevent whatever mechanism exists on the
platform to mitigate improper filtering of network requests at
launch. For example, in Chromium-based browsers, unchecking the
new setting will prevent the browser from re-loading tabs for
which there was network activity while in "suspended" state at
launch.
2021-12-30 09:24:38 -05:00
Raymond Hill
0c03244759
Add string related to network activity suspension at launch
Related discussion:
- a0a9497b4a (commitcomment-62560291)
2021-12-30 09:23:28 -05:00
Raymond Hill
81c38ea6ff
Import translation work from https://crowdin.com/project/ublock 2021-12-30 09:13:52 -05:00
Raymond Hill
869c06d4ee
Fix broken suspendTabsUntilReady for Chromium-based browsers
Related feedback:
- a0a9497b4a (commitcomment-62560291)

Regression from following commit:
- 80b758e18d
2021-12-27 19:08:17 -05:00
Raymond Hill
57e660e39b
Make FilterJustOrigin derive from FilterOriginHitSet
By reusing FilterOriginHitSet for FilterJustOrigin, this
remove the need to special-case entity-based just-origin
filters.
2021-12-26 10:46:59 -05:00
Raymond Hill
a036f52217
Import translation work from https://crowdin.com/project/ublock 2021-12-25 08:11:17 -05:00
Raymond Hill
348ca49494
Fix argument value to boolean
Related feedback:
- a0a9497b4a (r62465396)
2021-12-25 07:55:30 -05:00
Raymond Hill
d66cd1116c
Fix not properly resetting needle buffer in createTrieFromStoredDomainOpt()
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1902

The cached needle didn't match the one stored in the
needle buffer when resetting the cached needle without
resetting the needle buffer.
2021-12-25 07:51:12 -05:00
Raymond Hill
7bec4e1a83
Import translation work from https://crowdin.com/project/ublock 2021-12-22 09:42:20 -05:00
Raymond Hill
1565aae7dd
Import translation work from https://crowdin.com/project/ublock 2021-12-19 10:17:14 -05:00
Raymond Hill
e4a7df3fd9
Improve auto-completion in _"My filters"_ editor 2021-12-19 08:17:06 -05:00
Raymond Hill
a86e804c9c
Assign min width to the button
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1886
2021-12-19 08:13:43 -05:00
Raymond Hill
e45d851f66
Store domain= option into trie container's character buffer
As the trie is not immediately created, in order to speed up
launch time, the `domain=` option was stored in the filterRefs
array until it was moved to the trie.

This commit instead stores the `domain=` option into the trie
container's character buffer.
2021-12-18 12:53:09 -05:00
Raymond Hill
47680c775d
Limit force-reload at launch to https-based pages
Related commit:
- a0a9497b4a
2021-12-18 12:24:55 -05:00
Raymond Hill
7ca2c8a9a7
Make loadBenchmarkDataset() compatible with more recent requests.json
The format of requests.json used in latest Cliqz benchmark code
has changed from the original one -- this commit makes the
dataset load code also compatible with the new format.

More recent dataset used in Cliqz benchmark code:
- https://github.com/mjethani/scaling-palm-tree

Cliqz benchmark code:
- https://github.com/ghostery/adblocker/tree/master/packages/adblocker-benchmarks
2021-12-18 11:44:01 -05:00
Raymond Hill
7da0ccd55b
Fine tune reporting of CFE internals 2021-12-18 11:35:50 -05:00
Raymond Hill
a0a9497b4a
Partially bring suspendTabsUntilReady out of experimental status
This commit will force-reload active tabs at launch for
environments not supporting suspend network request listeners,
or configured to not suspend network request listeners.
2021-12-18 11:26:50 -05:00
Raymond Hill
edab87b4bc
Fix potentially reporting wrong context in logger for ghide filters
Related discussion:
- https://github.com/uBlockOrigin/uAssets/issues/3100#issuecomment-996750389
2021-12-17 09:47:14 -05:00
Raymond Hill
2576a991e5
Drop obsolete sentence (fix #1882)
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1882
2021-12-17 08:25:28 -05:00
Raymond Hill
aff6447ab6
Import translation work from https://crowdin.com/project/ublock 2021-12-16 09:38:47 -05:00
Raymond Hill
df56fc55d2
Fine-tune static network filtering engine code
Refactored heuristics to collate set of origin-related
filter units are collated into a hostname trie, and
for better reuse of existing classes.

Generalized pre-test idea for bucket of filters, such
that in addition to origin-related filter units, there is
now a class to collate regex-based pattern-related units
into a new pre-test bucket class, FilterBucketIfRegexHits,
in order to test with a single regex test whether there is
a chance of a hit in the underlying bucket of filters.
Instances of these are rare, but at time of commit I found
this occurs with AdGuard France filter list.

Fine-tuned the "SNFE: Dump" output -- this new ability to
see the internal details of the SNFE has been really key
into finding/fixing issues during refactoring.
2021-12-16 09:12:43 -05:00
Raymond Hill
fb0de0cc9c
Wait for placeholders to be present
Related issue:
- https://www.reddit.com/r/uBlockOrigin/comments/rgxlda/adblock_detected/

Related discussion:
- 137070f226 (commitcomment-61964299)
2021-12-15 09:08:04 -05:00
Raymond Hill
01f87e979e
Add ability to fold/unfold in devtools page 2021-12-14 09:58:38 -05:00
Raymond Hill
6c5dcb43da
Fix bad copy-paste 2021-12-13 13:13:49 -05:00
Raymond Hill
8887db1e70
Add ability to collapse/expand in uBO's devtools page 2021-12-13 10:47:53 -05:00
Raymond Hill
ba22735fcc
Add ability to dump internal details of cosmetic filtering engine
Related commit:
- 4d482f9133
2021-12-13 08:30:12 -05:00
Raymond Hill
edd11e16fa
Fix not reporting match-case properly in logger
Related feedback:
- 4d482f9133
2021-12-13 07:01:04 -05:00
Raymond Hill
99882cacd0
Truncate support information when too many lists are added
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1852
2021-12-12 11:31:31 -05:00
Raymond Hill
4d482f9133
Store regex filter pattern into bidi-trie buffer
As was done with generic pattern-based filters, the source
string of regex-based filters is now stored into the
bidi-trie (pattern) buffer.

Additionally, added a new "dev tools" page to more
conveniently peer into uBO's internals at run time, without
having to do so from the browser's dev console -- something
which has become more difficult with the use of JS modules.

The new page can be launched from the Support pane through
the "More" button in the troubleshooting section.

The benchmark button in the About pane has been moved to this
new "dev tools" page.

The new "dev tools" page is for development purpose only,
do not open issues about it.
2021-12-12 10:32:49 -05:00
Raymond Hill
3b7a265ee2
Ignore pointless trailling *^ in network filters
There are currently over 160 patterns with such pointless
trailing `*^` in uBO's filter lists, which ended up being
compiled as generic pattern filters (i.e. regex-based
internally), while the trailing `*^` accomplishes nothing
since it will always match the end of a URL ( `^` can
also match the end of URL).

This commit discards pointless trailing `*^` in patterns,
thus allowing most of those filters to be compiled as
plain pattern filters.

The syntax highlighter will reflect that a trailing
`*^` is pointless.
2021-12-11 09:45:25 -05:00
Raymond Hill
7a908d293f
Remove obsolete setting
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/1872
2021-12-11 05:56:34 -05:00
Raymond Hill
f9e4a10933
Adjust compile/selfie format verison 2021-12-10 08:05:45 -05:00
Raymond Hill
54074af029
Avoid counting important filters as two filters
Rearrange logic to instantiate and add `important` filters
to the block realm when compiled lists are loaded instead
of when lists are compiled.

Additionally, removed now unused properties following
commit 68e14793cc.
2021-12-10 07:56:15 -05:00
Raymond Hill
6ebebbe23c
Adjust color of cloud storage widget for datk theme
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1867
2021-12-10 07:52:52 -05:00
Raymond Hill
1490fd606b
Simplify often-executed regex 2021-12-10 07:47:21 -05:00
Raymond Hill
c71b7c7a42
Merge launchFromSelfie into launchToReadiness 2021-12-08 13:43:02 -05:00
Raymond Hill
d17d634b7c
Define new nobab scriptlet
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1863

As per internal discussion with team, best to have a simpler
scriplet, and which is hard-coded to work only on a specific
set of domains -- only those seen used by BAB.
2021-12-08 12:10:18 -05:00
Raymond Hill
c552aa110e
Import translation work from https://crowdin.com/project/ublock 2021-12-08 10:44:57 -05:00
Raymond Hill
2b2af1f20d
Store generic pattern string into bidi-trie buffer 2021-12-08 10:26:52 -05:00
Raymond Hill
92ad101557
Update nobab.js scriptlet
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1863

As discussed internally with uBO filters team.
2021-12-08 10:24:03 -05:00
Raymond Hill
72bb89495b
Change compiled list format to a saner block id management
Just use self-described readable section identifiers instead
of difficult-to-manage arbitrary integers.
2021-12-07 11:15:14 -05:00
Raymond Hill
68e14793cc
Remove classes specialized in handling single-wildcarded patterns
Turns out the various benchmarks show no benefits when compiling
filters whose pattern contains a single wildcard character into
specialized classes which threat the pattern as two sub-patterns,
and actually there is a slight improvement in performance as per
benchamrks when treating these patterns as generic ones.

This also fixes the following related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1207
2021-12-06 12:03:52 -05:00
Raymond Hill
55fc4ba5e5
Use effective frame URL for about:blank frames
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1858
2021-12-06 11:59:48 -05:00
Raymond Hill
d3fe0ccfe0
Fix regression with csp=, deprecate queryprune, etc
Fixed serious regression in previous dev build in applying
`csp=` filters. Reported internally by uBO team.

Promote usage of `removeparam` in code instead of `queryprune`,
which is to be deprecated.

Removed test against previously tested hostname in
FilterHostnameDict since as per various benchmark, the
test does not really help.

Remove serialization API in Node.js code as the API is now
present in SNFE itself.
2021-12-06 07:01:39 -05:00
Raymond Hill
7888e49c00
Fix race condition when loading from selfie
All the auxiliary data structures must be fully loaded before
the data structure used as entry point is populated. The race
condition could lead to a case of the entry point data structure
being populated while the auxiliary data structures are still
unpopulated, potentially causing exceptions to be thrown at
launch when the static network filtering engine is queried.

I haven't been able to reproduce such exceptions -- but it
could happen on browsers which do not support being suspended
at launch time (i.e. chromium-based browsers).

Additionally, added convenience methods to easily
serialize/unserialize when SNFE is used as a npm package.
2021-12-05 14:05:32 -05:00
Raymond Hill
0948ad7d0a
Import translation work from https://crowdin.com/project/ublock 2021-12-05 09:11:28 -05:00
Raymond Hill
634ffc9d14
Fix throttling of optimization cycles
This should help lower time-to-readiness when uBO
is launched on less powerful devices.
2021-12-05 09:07:02 -05:00
Raymond Hill
b78b277907
Add missing code to properly grow buffer
Related feedback:
- https://github.com/orgs/uBlockOrigin/teams/ublock-issues-volunteers/discussions/293

Related commit:
- 725e6931f5

Through all the changes, forgot to pay attention to scenarios
where the `filterData` needs to grow -- the buffer's defautl
size is set to accomodate default filter lists, and subscribing
to more lists would cause the static network filtering engine
to fail because the buffer was not resized when needed.
2021-12-04 17:06:09 -05:00
Raymond Hill
7c6d3241bb
Import translation work from https://crowdin.com/project/ublock 2021-12-04 11:57:45 -05:00
Raymond Hill
5c10b13ade
Fix text in Support pane, as per feedback
Related feedback:
- https://crowdin.com/translate/ublock/13/enca-nl?filter=basic&value=4#1153
2021-12-04 11:53:23 -05:00
Raymond Hill
0df8986b52
Fix make lint warning 2021-12-04 11:48:17 -05:00
Raymond Hill
725e6931f5
Refactoring work in static network filtering engine
The original motivation is to further speed up launch time
for either non-selfie-based and selfie-based initialization
of the static network filtering engine (SNFE).

As a result of the refactoring:

Filters are no longer instance-based, they are sequence-of-
integer-based. This eliminates the need to create instances
of filters at launch, and consequently eliminates all the
calls to class constructors, the resulting churning of memory,
and so forth.

All the properties defining filter instances are now as much
as possible 32-bit integer-based, and these are allocated in a
single module-scoped typed array -- this eliminates the need
to allocate memory for every filter being instantiated.

Not all filter properties can be represented as a 32-bit
integer, and in this case a filter class can allocate slots
into another module-scoped array of references.

As a result, this eliminates a lot of memory allocations when
the SNFE is populated with filters, and this makes the saving
and loading of selfie more straightforward, as the operation
is reduced to saving/loading two arrays, one of 32-bit
integers, and the other, much smaller, an array JSON-able
values.

All filter classes now only contain static methods, and all
of these methods are called with an index to the specific
filter data in the module-scoped array of 32-bit integers.

The filter sequences (used to avoid the use of JS arrays) are
also allocated in the single module-scoped array of 32-bit
integers -- they used to be stored in their own dedicated
array.

Additionally, some filters are now loaded more in a deferred
way, so as reduce uBO's time-to-readiness -- the outcome of
this still needs to be evaluated, time-to-readiness is
especially a concern in Firefox for Android or less powerful
computers.
2021-12-04 11:16:44 -05:00
Raymond Hill
64f427d0e5
Have getAll() returns at least one neutered Tracker object
Related discussion:
- https://github.com/uBlockOrigin/uAssets/issues/10731#issuecomment-986031354
2021-12-04 11:07:19 -05:00
Raymond Hill
ccc4c7d41f
Log selfie-related events at launch time 2021-12-04 10:55:33 -05:00
Raymond Hill
1becd8ad18
Use removeparam, queryprune is deprecated 2021-12-04 10:52:24 -05:00
Raymond Hill
7428e117b5
Remove pointless setting from support information 2021-12-04 10:44:57 -05:00
Raymond Hill
5f7d005e3d
Fix pointless use of parenthesis in regex 2021-12-02 17:58:52 -05:00
Raymond Hill
99dfce0b44
Fix make lint warning 2021-12-02 17:58:17 -05:00
Raymond Hill
33ab856e86
Import translation work from https://crowdin.com/project/ublock 2021-11-30 08:04:45 -05:00
Raymond Hill
395a4e36a9
Officialize uiPopupConfig advanced setting
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1817#issuecomment-981104204
2021-11-28 10:35:50 -05:00
Raymond Hill
aad90eb323
More fine tuning of filter issue report feature 2021-11-28 07:47:16 -05:00
Raymond Hill
a06296d4e8
Import translation work from https://crowdin.com/project/ublock 2021-11-27 12:10:31 -05:00
Raymond Hill
1408422cba
Fine tune new reporting feature
Add ability to bring back logger button in popup panel through
the advanced setting `uiPopupConfig`. Adding `+logger` token
to `uiPopupConfig` will bring back the logger icon in the mobile
version of the popup panel.

Additionally, the link to the logger in the Support pane will
take into account whether the <Shift> key is pressed, so as
to behave like the logger icon in the popup panel.

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1847

The troubleshooting information has been further fine-tuned to
report popup panel data related to the reported page, for better
diagnosis by disclosing any customization to uBO which was
affecting the reported page.
2021-11-27 11:58:32 -05:00
Raymond Hill
a2444a8c25
Import translation work from https://crowdin.com/project/ublock 2021-11-26 12:30:50 -05:00
Raymond Hill
74d1f90264
Allow reporter to select a choice of URLs to report
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1836

The URL to report can now be picked from a list of related
URLs in order to allow the reporter to publish edited version
of the reported URL.

Additionally, the hash, user name, and password which could be
present in a reported URL are always removed.
2021-11-26 12:23:18 -05:00
Raymond Hill
1ac9c5ceb7
Reject generic HTML block filters
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1844

Generic HTML block filters will by highlighted as invalid and
rejected by uBO at compile time.
2021-11-24 18:14:09 -05:00
Raymond Hill
3cf3ec595f
Import translation work from https://crowdin.com/project/ublock 2021-11-22 09:06:02 -05:00
Raymond Hill
374d4800e5
Arrow functions are not instanceof Function
But their `typeof` is `function`, so use this instead to
detect whether an argument is a function which can be
called.

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/qyx7en/
2021-11-21 11:19:12 -05:00
Raymond Hill
5845aa3d73
Import translation work from https://crowdin.com/project/ublock 2021-11-21 08:00:22 -05:00
Raymond Hill
2fae1ce90e
Remove ability to unredact
Unredacted settings is unlikely to be useful after all,
and removing the ability to unredact ensure users won't
mistakenly publish unredacted information.
2021-11-21 07:53:36 -05:00
Raymond Hill
a240392e07
Import translation work from https://crowdin.com/project/ublock 2021-11-20 09:39:48 -05:00
Raymond Hill
5d51d172c4
Collapse config details by default 2021-11-20 09:38:00 -05:00
Raymond Hill
69a2f123c5
Import translation work from https://crowdin.com/project/ublock 2021-11-19 08:32:11 -05:00
Raymond Hill
5c48e32344
Import translation work from https://crowdin.com/project/ublock 2021-11-18 11:24:07 -05:00
Raymond Hill
bb3c75e37a
Better English, I think 2021-11-18 11:13:04 -05:00
Raymond Hill
e9ea57e9ac
Use real quotes (i.e. not HTML encoded)
So that translators can replace them mor eeasily with
whatever quotes is most appropriate for the language.
2021-11-17 09:37:11 -05:00
Raymond Hill
6566f496c2
Import translation work from https://crowdin.com/project/ublock 2021-11-17 08:23:57 -05:00
Raymond Hill
30cc04c76e
Import translation work from https://crowdin.com/project/ublock 2021-11-16 08:14:46 -05:00
Raymond Hill
d49b979732
Add ability to label report as "nsfw" 2021-11-16 08:11:04 -05:00
Raymond Hill
cf85bf1d53
Import translation work from https://crowdin.com/project/ublock 2021-11-16 07:39:47 -05:00
Raymond Hill
767f81b292
Import translation work from https://crowdin.com/project/ublock 2021-11-15 10:52:56 -05:00
Raymond Hill
bc44371f93
Import translation work from https://crowdin.com/project/ublock 2021-11-15 10:51:59 -05:00
Raymond Hill
45e5c87084
Fine tune filter issue reporter page
Added an entry to report popups.

Added extra information about how uBO launched.
2021-11-15 10:46:29 -05:00
Raymond Hill
c90b2e4d6f
Fix bad indentation in support data 2021-11-14 13:40:00 -05:00
Raymond Hill
8585989f44
Import translation work from https://crowdin.com/project/ublock 2021-11-14 08:21:45 -05:00
Raymond Hill
50436ced61
Further fine-tune configuration information in Support pane 2021-11-14 08:13:43 -05:00
Raymond Hill
52063c8633
Force-close popup panel when reporting a filter issue
Necessary on Firefox.
2021-11-13 12:18:26 -05:00
Raymond Hill
19bdbddbfc
Emphase GitHub account requirement 2021-11-13 11:48:36 -05:00
Raymond Hill
74fd28c76b
Import translation work from https://crowdin.com/project/ublock 2021-11-13 11:43:22 -05:00
Raymond Hill
064ffe4cc7
Remove usage of CSS zoom
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1793
2021-11-13 11:05:35 -05:00
Raymond Hill
e1c386515a
Report specific filter issue through a template
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1541#issuecomment-966697347
2021-11-12 09:11:28 -05:00
Raymond Hill
dea7184f30
Do not decode query parameter name when used as token
Related feedback:
- https://github.com/DandelionSprout/adfilt/discussions/163#discussioncomment-1628496
2021-11-12 08:24:30 -05:00
Raymond Hill
d142066f95
Fix incorrect redaction of user filterset
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1541#issuecomment-966543580
2021-11-11 14:06:59 -05:00
Raymond Hill
acb5b9d649
Import translation work from https://crowdin.com/project/ublock 2021-11-11 13:00:17 -05:00
Raymond Hill
eccf613edf
Add ability to report filter issue from popup panel
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1541

A "chat" icon has been added to the popup panel to make
it easy to report filter issue on specific sites.

Reporting filter issues require a GitHub account, since
uBO does not have a home server through which reports could
be sent.

The report icon is available only for when uBO is enabled
on a given site.

On mobile devices, the logger icon is replaced by the "chat"
icon since it is more likely to be useful on small display
devices. The logger can always be opened from the Support
pane in the dashboard.
2021-11-11 12:49:55 -05:00
Raymond Hill
9fbc50f14f
Harden detection of // in style declaration
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1811#issuecomment-966323765
2021-11-11 09:05:10 -05:00
Raymond Hill
5d22b51668
Forbid usage of inage-set as style property
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1811

Additionally, forbid style declaration with at least one
instance of `//` at any position.
2021-11-11 08:33:28 -05:00
Raymond Hill
c2c2cef4e6
Fix bad test breaking list subscription
Related issue/feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1797#issuecomment-965150304
2021-11-10 08:49:28 -05:00
Raymond Hill
3b53c3a3e3
Further improve GA's surrogate script
Related issue:
- https://github.com/AdguardTeam/Scriptlets/issues/154

Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1807
2021-11-09 15:18:30 -05:00
Raymond Hill
6f49e079db
Improve GA's surrogate script
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1807
2021-11-09 13:20:49 -05:00
Raymond Hill
4efa6be96b
Fix sticky imported list after removal
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1803
2021-11-08 12:49:03 -05:00
Raymond Hill
97232baee3
Forbid multiple and unexpected CSS style declarations
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1806#issuecomment-963278382
2021-11-08 11:17:47 -05:00
Raymond Hill
af42e50824
Import translation work from https://crowdin.com/project/ublock 2021-11-08 09:23:48 -05:00
Raymond Hill
630d436342
Forbid usage of opening comment /* in query-selectable test
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1806
2021-11-08 09:13:58 -05:00
Raymond Hill
5daa6a7ff3
Get current language using extensions API (instead of navigator.language)
Related feedback:
- https://github.com/gorhill/uBlock/pull/3860
2021-11-06 12:49:27 -04:00
Raymond Hill
c97d12c1d6
Remove bad test
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1798
2021-11-04 15:54:24 -04:00
Raymond Hill
955fe944ca
Suggest network filter as best candidate by default
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/qmjk36/

Regression from:
- d930504e3e

Also, fix immediately selecting the resource when using
contextual menu with cosmetic filtering off.
2021-11-04 12:42:48 -04:00
Raymond Hill
b63415a3db
Fix breaking navigation through links [regression]
Regression from:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1797
2021-11-04 11:48:07 -04:00
Raymond Hill
27c1874425
Import translation work from https://crowdin.com/project/ublock 2021-11-04 09:34:44 -04:00
Raymond Hill
8b8b7da8d9
Forbid subscribing to filter lists with invalid URLs
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1797
2021-11-04 08:52:06 -04:00
Raymond Hill
2ab39aee23
Fix not highlighting cases of invalid syntax
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1791

The following case of invalid syntax was not reported as
invalid by the syntax highlighter:

    ... example.com image ...

With dynamic filtering, there can't be a specific
hostname when a specific type is used, or a
specific type when a specific hostname is used, one
or the other must be `*`.
2021-10-31 13:18:31 -04:00
Raymond Hill
0d3028f71f
Import translation work from https://crowdin.com/project/ublock 2021-10-30 11:57:55 -04:00
Raymond Hill
8f2e1b4d84
Avoid testing sheet-selectability when filter is hinted as procedural
uBO support's `#?#`, which in AdGuard and ABP means that a
cosmetic filter is procedural.

However, uBO interprets this syntax as "probably procedural"
and will use the filter in a declarative way if the filter
is found to be stylesheet-compatible.

In reality though, the likelihood that a "probably procedural"
filter is sheet-selectable is very low, so treating the filter
as procedural a priori help saves pointless tests against
sheet-selectability when using lists primarily designed for
AdGuard or ABP.
2021-10-29 08:33:55 -04:00
Raymond Hill
3891b4d050
query-selectable selectors are not necessarily sheet-selectable
Related commits:
- 4f923384de
- 97a33c9572
- ef07171f5a

For instance, with "Experimental Web Platform features" enabled, the
following filter becomes natively query-selectable:

    .fail:has(+ a > b)

Meaning uBO won't need to emulate the `:has()` operator, it will
be executed natively using `querySelectorAll()`.

This commit fixes the erroneous assumption that a query-selectable
is also sheet-selectable.
2021-10-28 10:36:26 -04:00
Raymond Hill
ef07171f5a
Refactor how cosmetic filters with pseudo-elements are parsed
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1247#issuecomment-953284365

Distinguish between selectors which can be querySelector-ed
and/or used ni a stylesheet.
2021-10-27 18:09:02 -04:00
Raymond Hill
97a33c9572
Fix test for stylesheet presence
Related commit:
- 4f923384de
2021-10-27 15:13:13 -04:00
Raymond Hill
4f03b6c4c2
Import translation work from https://crowdin.com/project/ublock 2021-10-27 13:27:45 -04:00
Raymond Hill
4f923384de
Use an actual stylesheet to validate cosmetic filters
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1751

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/qgd6fe/

It turns out Chromium has started to implement the `:has()`
operator, which becomes recognized when the browser flag
"Experimental Web Platform features" is enabled. However the
hic is that `:has()` is not supported as a declarative CSS
style rule and is only supported through `querySelector()`
et al.

The fix is to no longer detect plain CSS selectors through
`querySelector` et al. but rather use an actual stylesheet
to validate that a cosmetic filter can be injected into a
stylesheet in a declarative way.

Additionally, I added support to enforce ABP's semantic
regarding cosmetic filter with the `#?#` anchor: when using
such anchor, uBO will _first_ try to compile the filter as
a procedural one rather than a declarative one.

Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1011#issuecomment-884824166
2021-10-27 12:56:37 -04:00
Raymond Hill
986c25fe24
Add Somali language 2021-10-26 09:10:37 -04:00
Raymond Hill
90ed078178
Import translation work from https://crowdin.com/project/ublock 2021-10-26 09:09:36 -04:00
Raymond Hill
5bea149e8f
Fix spurious errors in uBO's dev console
Those spurious errors occurred when launching the browser
with the dashboard already opened from the previous
browsing session.
2021-10-26 08:54:04 -04:00
Raymond Hill
c136c7b454
Auto-escape commas in removeparam's regexes
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/760#issuecomment-951146371

This is a quick fix, some refactoring necessary for a more
comprehensive fix to all such issues.
2021-10-26 08:51:55 -04:00
Raymond Hill
d5cfd673dc
Condense list details in Support pane
Related commit:
- a3a43c7cb4
2021-10-22 14:59:41 -04:00
Raymond Hill
90fd3b6973
Import translation work from https://crowdin.com/project/ublock 2021-10-22 08:32:59 -04:00
Raymond Hill
d9eb0b1002
Import translation work from https://crowdin.com/project/ublock 2021-10-18 11:12:16 -04:00
Raymond Hill
65985343fc
Create new page store if not found in tab event
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/757

Sometimes a tab event may fire for a tab which is not
yet known to uBO. In such case, bind the tab internally
so that it can be processed properly in the future.
2021-10-18 09:43:41 -04:00
Raymond Hill
c2269d7202
Minor CSS fix 2021-10-18 09:11:34 -04:00
Raymond Hill
a72aa58c92
Adjust font-size for code tags 2021-10-17 13:47:41 -04:00
Raymond Hill
f56ad0100a
Import translation work from https://crowdin.com/project/ublock 2021-10-17 13:17:34 -04:00
Raymond Hill
9b7dd61b1d
Import translation work from https://crowdin.com/project/ublock 2021-10-16 09:02:52 -04:00
Raymond Hill
c44117aa70
Further fine tune Support pane
Related commit:
- a3a43c7cb4
2021-10-16 08:43:31 -04:00
Raymond Hill
cd5f58779b
Also check for unsupported tags in descendants 2021-10-16 08:42:55 -04:00
Raymond Hill
c7f1af9547
Fix regression in DOM inspector
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1765

Related commit:
- 1285f78e05 (diff-77e1325098616e4d2bb6b1e9ccf3b7cb9898942739e29f01b63346220f55b2b8L250-R250)
2021-10-15 16:55:40 -04:00
Raymond Hill
f37acd9fe0
Import translation work from https://crowdin.com/project/ublock 2021-10-15 15:00:13 -04:00
Raymond Hill
730735cc5e
Further fine-tune new Support pane
Related commit:
- a3a43c7cb4

Specifically:
- Support i18n
- Autofill issues opened through Support pane with configuration
  information
- Remove from About pane items found in Support pane
2021-10-15 14:50:34 -04:00
Raymond Hill
2c7fcf7284
Simplify handling of valid HTML tags in i18n files
Use DOMParser instead of trying to manually parse
the HTML tags appearing in i18n files.
2021-10-15 14:49:02 -04:00
Raymond Hill
d591e3094e
Import translation work from https://crowdin.com/project/ublock 2021-10-15 14:44:20 -04:00
Raymond Hill
415870ba31
Import translation work from https://crowdin.com/project/ublock 2021-10-15 07:59:06 -04:00
Raymond Hill
24553163c5
Minor fixes to new Support page 2021-10-14 12:00:24 -04:00
Raymond Hill
aceaea0122
Minor code review 2021-10-14 09:22:36 -04:00
Eli Grey
1285f78e05
Don't assume document.documentElement is non-null (#3857)
* Fix uBlockOrigin/uBlock-issues#1756

This PR fixes uBlockOrigin/uBlock-issues#1756.

* fix dom-inspector.js

* more explicit if statements

* these changes should also be safe
2021-10-14 09:08:08 -04:00
Raymond Hill
9d0e72b243
Further fine-tuning new Support pane
Related commit:
- a3a43c7cb4
2021-10-14 08:54:38 -04:00
Raymond Hill
a839460f32
Import translation work from https://crowdin.com/project/ublock/ 2021-10-13 11:28:48 -04:00
Raymond Hill
f9989f30d8
Further improve new Support pane
For now the language locales are not available as the text on
the page needs to stabilize before asking translation
volunteers to contribute their time working on the new text.
2021-10-13 11:18:23 -04:00
Raymond Hill
e7444883a3
Fine tune data reported in Support pane
Related commit:
- a3a43c7cb4
2021-10-13 08:31:04 -04:00
Raymond Hill
6836809aad
Make Shortcut pane not present by default [Firefox]
By default uBO assumed the Shortcut pane was needed,
unless it found the current version of FF was higher
than 73. This commit reverses the test, it assumes
the Shortcut pane is not needed, unless the current
version is lower than 74.
2021-10-13 08:23:20 -04:00
Raymond Hill
1638753657
Import translation work from https://crowdin.com/project/ublock 2021-10-12 11:36:43 -04:00
Raymond Hill
a3a43c7cb4
Add "Support" pane to dashboard
The purpose is to allow users to make it easy to share
technical information about their uBO configuration, and
to make it easy for volunteers to diagnose issues.

This is a first step toward the goal of making it easier
for users to report issues with either uBO or filter
issues on websites.

Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1701
- https://github.com/uBlockOrigin/uBlock-issues/issues/1541
2021-10-12 11:19:56 -04:00
Raymond Hill
01cbe7520d
Fix regression with no-cosmetic-filtering switch
Related commit:
- c4b7ee80ea
2021-10-11 07:07:41 -04:00
Raymond Hill
c4b7ee80ea
Further work on JS modules
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1664
2021-10-07 14:41:29 -04:00
Raymond Hill
c0cba22771
Fix regression of isBlockImportant()
isBlockImportant() was relying strictly on the hash bits
to detect whether a matching filter was `important`, but
this approach regressed with changes with how `important`
filters are compiled. This commit fixed this by no longer
relying on the hash bits but rather on an internal
register variable being set by `important` filters when
they match.

I couldn't find any actual cases in default filter lists
(including a couple of default regional lists) that the
regression is having any effect, due to the limited cases
for which isBlockImportant() is called.

A test was added in a previous commit to detect such
regression in the future:
- a76935b232
2021-10-06 09:57:49 -04:00
Raymond Hill
6464002088
Give precedence to negated types in case of ambiguity
Related feedback:
- https://github.com/uBlockOrigin/uAssets/issues/7639#issuecomment-933525018
2021-10-06 09:44:15 -04:00
Raymond Hill
a6cd954a2a
Fix handling of negated types in all filter option
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1730

Related commit:
- 8f98622374
2021-09-25 12:36:33 -04:00
Raymond Hill
1130746a9b
Fix regression with important filter option
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1732

The regression affect filter with the `important` option when
the following conditions were fulfilled:

- The filter pattern is pure hostname
- The filter has not one of the following options:
  - domain
  - denyallow
  - header
  - strict1p, strict3p
  - csp
  - removeparam
- There is a matching exception filter

Related commit:
- a2a8ef7e85

A related mocha test has been added in order to detect this
specific regression in the future through `make test`.
2021-09-24 11:09:32 -04:00
Raymond Hill
8f98622374
Refactor implementation of ~[type] filter options
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1730

A new filter unit, FilterNotType, is introduced to enforce
negated filter type options.

Before this commit, there was no actual negated types in the
static network filtering engine, as a negated type was internally
converted to non-negated types at compile time. As a result,
the logger would never output a matching filter with its original
negated type options.

This commit no longer causes an internal conversion to take place
at compile time, but explicitly enforce negated types at match time,
and as a result the logger will from now on output matching filter
with their original negated type options.
2021-09-23 09:38:27 -04:00
Raymond Hill
f49c4e254b
Add advanced setting to default modify webext flavor
Name: modifyWebextFlavor

Value: A list of space-separated tokens to be added/removed from the
computed default webext flavor.

The primary purpose is to give filter list authors the ability to
test mobile flavor on desktop computers. Though mobile versions of
web pages can be emulated using browser dev tools, it's not
possible to do so for uBO itself.

By using `+mobile` as a value for this setting will force uBO
to act as if it's being executed on a mobile device.

Important: this setting is best used in a dedicated browser
profile, as this affects how filter lists are compiled. So best
to set it in a new browser profile, then force all filter lists
to be recompiled, and use the profile in the future when there
is a need to test the specific webext flavor.
2021-09-22 09:37:21 -04:00
Raymond Hill
33a18c3a1e
Convert fingerprint2.js scriptlet into a redirectable resource
As per internal discussion with volunteer filter list
maintainers.
2021-09-18 10:55:22 -04:00
Raymond Hill
4100761863
Keep ability to prevent local IP address leaks for mobile version
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1723

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1723#issuecomment-919913361
2021-09-15 08:28:10 -04:00
Raymond Hill
831cf478da
Revert "Remove now obsolete webrtc-related setting"
This reverts commit af41aadab7.
2021-09-15 07:40:32 -04:00
Raymond Hill
af41aadab7
Remove now obsolete webrtc-related setting
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1723

The leaking of local IP addresses is no longer an issue
in modern browsers.
2021-09-14 10:04:35 -04:00
Raymond Hill
0e3f26ff05
Import translation work from https://crowdin.com/project/ublock 2021-09-13 10:53:00 -04:00
Raymond Hill
d930504e3e
Better lookup all elements under mouse cursor in element picker
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/pefaov/elementpickerzapper_often_misses_images/hcnycbx/?context=3
2021-09-13 10:39:17 -04:00
Raymond Hill
a3a66d0e31
Avoid parsing query parameters with URLSearchParams
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1717
2021-09-12 12:17:46 -04:00
Raymond Hill
68dfe98045
Add visual hint to grab area of element picker dialog
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1714
2021-09-12 10:47:40 -04:00
Raymond Hill
c105f9965e
Import translation work from https://crowdin.com/project/ublock 2021-09-04 11:57:51 -04:00
Manish Jethani
19fb513d52
Update ./wasm/* files from publicsuffixlist.js (#3853) 2021-08-28 10:32:29 -04:00
Eli Grey
6e6697fab6
Fix typo in comment about buffer expiry
The code below the comment specifies 30 seconds, while the comment says 60 seconds. This PR fixes that typo to make the comment indicate 30 seconds.
2021-08-26 17:03:39 -07:00
Raymond Hill
46eb3801ec
Revert "Inject scriptlets at webNavigation.onCommitted time in Firefox"
This reverts commit 7ee9c21b37.

Potentially related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1696
2021-08-26 18:36:36 -04:00
Manish Jethani
498f90966d
Bring suffixInPSL() from upstream (#3851) 2021-08-26 08:50:49 -04:00
Raymond Hill
7ee9c21b37
Inject scriptlets at webNavigation.onCommitted time in Firefox
Just as is the case with Chromium.

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1694
2021-08-25 09:24:10 -04:00
Raymond Hill
a2d8545382
Forbid instances of /* in :style() operator
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1693
2021-08-25 07:43:26 -04:00
Raymond Hill
6dcd5df991
Take into account simple selectors present in array of selectors
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1692
2021-08-24 12:29:48 -04:00
Raymond Hill
18b0fa03f2
Import translation work from https://crowdin.com/project/ublock 2021-08-24 10:10:07 -04:00
Raymond Hill
f0b46bde4f
Mitigate generic cosmetic filters erroneously targeting html/body
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1692

The ids/classes from html/body elements will leave out
looking up lowly generic cosmetic filters made of a single
identifier.

This does not absolutely guarantee that html/body elements
will never be targeted, but it should greatly mitigate the
probability that this erroneously happens.
2021-08-24 10:03:25 -04:00
Manish Jethani
925c01dc14
Fix ESLint globals error in biditrie.js (#3850) 2021-08-23 11:10:49 -04:00
Manish Jethani
d959c7aabe
Remove globals.js (#3849) 2021-08-23 10:54:16 -04:00
Manish Jethani
d13294dd39
Remove globals usage from background.js (#3848) 2021-08-23 10:28:44 -04:00
Manish Jethani
724a946c79
Remove globals usage from start.js (#3847) 2021-08-23 10:16:02 -04:00
Manish Jethani
9761b02c79
Convert publicsuffixlist.js into an ES module (#3846) 2021-08-23 09:42:27 -04:00
Raymond Hill
ba83c21354
Fix trie instance iterator 2021-08-22 13:06:05 -04:00
Manish Jethani
9ddbb293c0
Convert punycode.js into an ES module (#3845) 2021-08-22 12:03:59 -04:00
Raymond Hill
cfa00797ed
Add spacer at the bottom of popup panel in portrait mode
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1604
- https://github.com/uBlockOrigin/uBlock-issues/issues/1691
2021-08-22 10:20:31 -04:00
Manish Jethani
1bde1e5ecb
Convert regex.js into an ES module (#3844) 2021-08-22 08:25:06 -04:00
Raymond Hill
9d4006f2c3
Include query string when evaluating matches-path()
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1690#issuecomment-903133439
2021-08-21 11:50:46 -04:00
Raymond Hill
c0c70e2987
Fix normalization of matches-path operator
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1690
2021-08-21 10:20:43 -04:00
Raymond Hill
9dece3bd30
Add new procedural cosmetic operator: :matches-path(...)
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1690

New procedural operator: `:matches-path(...)`

Description: this is a all-or-nothing passthrough operator, which
on/off behavior is dictated by whether the argument match the
path of the current location. The argument can be either plain
text to be found at any position in the path, or a literal regex
against which the path is tested.

Whereas cosmetic filters can be made specific to whole domain,
the new `:matches-path()` operator allows to further narrow
the specificity according to the path of the current document
lcoation.

Typically this procedural operator is used as first operator in
a procedural cosmetic filter, so as to ensure that no further
matching work is performed should there be no match against the
current path of the current document location.

Example of usage:

    example.com##:matches-path(/shop) p

Will hide all `p` elements when visiting `https://example.com/shop/stuff`,
but not when visiting `https://example.com/` or any other page
on `example.com` which has no instance of `/shop` in the path part
of the URL.
2021-08-21 09:41:48 -04:00
Manish Jethani
5d2c295600
Remove globals usage from hntrie.js (#3842) 2021-08-21 07:33:53 -04:00
Manish Jethani
ab13903019
Remove globals usage from static-net-filtering.js (#3841) 2021-08-20 07:54:05 -04:00
Raymond Hill
19160f9018
Drop requestIdleCallback from globals
Related discussion:
- https://github.com/gorhill/uBlock/pull/3839

`requestIdleCallback` can be assumed always present on
browser-related platforms.
2021-08-19 07:31:27 -04:00
Raymond Hill
68675ed1cd
Remove pointless dependency on location
Related discussion:
- https://github.com/gorhill/uBlock/pull/3839#discussion_r691502793
2021-08-19 07:23:53 -04:00
Manish Jethani
b19393d8dc
Add tasks.js module (#3839) 2021-08-19 07:19:20 -04:00
Raymond Hill
9ceef65f9a
Fix regression with reporting "important" in logger
Related feedback:
- a2a8ef7e85 (commitcomment-54972030)
2021-08-17 07:32:54 -04:00
Raymond Hill
a33f70cf20
Provide compiler/selfie versions for snfe
So as to allow nodejs usage to better deal with
out of date serialization/compilation.

Additionally, use FilterImportant() only when a
"block-important" filter is stored in the "block" realm.
2021-08-16 12:15:30 -04:00
Raymond Hill
a2a8ef7e85
Avoid matching the block-important realm unconditionally
When matching a network request in the static network filtering
engine ("snfe"), these are the possible outcomes, from most
to least likely:

- No block
- Block
- Unblock ("exception" filter overriding the block)
- Block-important ("important" filter override the unblock)

Hence why the matching in the snfe always check for a match in
the "block" realm, and the "unblock" realm would be checked
if and only if there was a match in the "block" realm.

However the "block-important" realm was always matched against
first, and when a match in that realm was found, there would
be no need to check in other realms since nothing can override
the "important" option. The problem with this approach though
is that matches in the "block-important" realm are most
unlikely, which means pointless work being done for vast
majority of network requests.

This commit makes it so that the "block-important" realm is
matched against ONLY when there is a matched "unblock" filter.
The result is a measurable improvement in the snfe-related
benchmarks (though given the numbers involved, end users won't
perceive a difference).

Somewhat related discussion which was the motivation to look
more into this:

https://github.com/cliqz-oss/adblocker/discussions/2170#discussioncomment-1168125
2021-08-16 10:58:04 -04:00