Raymond Hill
267151a732
Import translation work from https://crowdin.com/project/ublock
2022-12-07 10:42:47 -05:00
Raymond Hill
a901606b97
combinatronics is no longer a CDN provider
2022-12-07 10:37:55 -05:00
Raymond Hill
26594fb902
Rework generic cosmetic filtering code
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2248
2022-12-07 10:30:09 -05:00
Raymond Hill
76d70102f0
Add pseudo-operator :matches-attr()
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2329
The supported syntax is exactly as per AdGuard's documentation:
- https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters#extended-css-matches-attr
Though recommended, the quotes are not mandatory in uBO if
the argument does not cause the parser to fail and if there
are no ambiguities.
Additionally, improved the code to better unquote pseudo-operator
arguments, and to bring it closer to how AdGuard does it as per
documentation. When using quotes, `"` and `\` should be escaped
to preserve these characters in the unquoted version of the
argument.
Additionally, it is now possible to have `:has-text()` match the
empty string by just quoting the empty string:
...##foo:has-text("")
2022-12-02 15:43:04 -05:00
Raymond Hill
bedfdff678
No need for arrow function for scoping
2022-11-29 12:01:16 -05:00
Raymond Hill
ef4dfb3131
Import translation work from https://crowdin.com/project/ublock
2022-11-29 10:34:51 -05:00
Raymond Hill
62601639f6
Detect invalid usage of combinators in :not() pseudoclass
...
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/z2ttcx/
2022-11-25 10:21:58 -05:00
Raymond Hill
92397baa39
Give more time for viewport to be ready
2022-11-24 11:21:13 -05:00
q1800
5811118277
Update about.html ( #3881 )
2022-11-23 13:54:50 -05:00
Raymond Hill
8d80f4788d
Trim content of Import field
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2380
2022-11-23 12:55:20 -05:00
Raymond Hill
3e4f6f9986
Import translation work from https://crowdin.com/project/ublock
2022-11-23 12:43:55 -05:00
Raymond Hill
bdc7a4c539
Handle potentially invalid CSS selector
...
Older browser versions may not support valid CSS selector syntax
in newer browser versions.
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/yzw5pt/
2022-11-21 08:57:55 -05:00
Raymond Hill
eb709335f8
Ensure state of more/less in panel reflect locked/disabled sections
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1059
2022-11-20 13:02:09 -05:00
Raymond Hill
fa216a43e4
Fix typo in string template code
...
Related commit:
- feaa338678
2022-11-20 10:17:05 -05:00
Raymond Hill
9b3ad0702c
Isolate generic cosmetic filters from specific ones in generated stylesheet
...
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/yzw5pt/
Some CSS4-based selectors are not supported in older browser versions
and this may cause cosmetic filtering to be wholly broken as a result.
The commit here is to isolate generic cosmetic filters from specific
ones in stylesheets such that unsupported CSS4 selectors in generic
cosmetic filters do not cause wholly breakage of cosmetic filtering
on all sites.
2022-11-20 10:08:28 -05:00
Raymond Hill
44753053c3
Prevent the creation of non-cosmetic extended filters in element picker
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2232
2022-11-19 12:29:10 -05:00
Raymond Hill
c818065c69
Update fix to regex library
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2374
2022-11-19 09:54:34 -05:00
Raymond Hill
4fb4ee1915
Handle negative character group
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2373
2022-11-18 13:37:48 -05:00
Raymond Hill
1c67869c42
Addendum to last commit as per feedback
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2372
2022-11-18 11:23:20 -05:00
Raymond Hill
42a7cfced3
Use already available stringified character code
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2372
2022-11-18 10:10:47 -05:00
Raymond Hill
04b8d495b6
Mind zero quantifier
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2371
2022-11-18 08:52:32 -05:00
Raymond Hill
122b84a6bc
Revert reversion
2022-11-17 13:39:19 -05:00
Raymond Hill
f46e5ef3b5
Further fix tokenization from regex
...
As per feedback/discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2368
- https://github.com/uBlockOrigin/uBlock-issues/issues/2367
2022-11-17 13:17:32 -05:00
Raymond Hill
69b899d0f9
Fix commit reference
2022-11-17 10:27:40 -05:00
Raymond Hill
105c7f5446
Fix visual of DOM inspector layer in dark theme mode
...
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2359
2022-11-17 09:25:20 -05:00
Raymond Hill
d9744d012a
Document changes to imported library
2022-11-17 08:53:41 -05:00
Raymond Hill
d51b7e082b
Improve extraction of tokens from regexes
...
Fixed flawed extraction of tokens with optional sequences, i.e.
when quantifier could be zero.
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2367
Ignore look-around sequences as suggested when normalizing into
tokenizable string.
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2368
Fix regex analyzer throwing with trailing `-` in character
class sequence.
Related issue:
- https://github.com/AdguardTeam/AdguardFilters/pull/134630
2022-11-17 08:53:41 -05:00
Raymond Hill
21110b0ff1
Use Unicode copyright symbol
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2336
2022-11-15 10:25:25 -05:00
Raymond Hill
2cc6835de0
Use placeholders to minimize vertical shifting at page load time
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2361
2022-11-15 09:44:19 -05:00
Raymond Hill
e68537513f
Sort of fix DOM inspector's visual with webpages in dark theme mode
...
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2359#discussioncomment-4126129
Removing `color-scheme` property fixes the issue. Not sure why.
2022-11-14 11:49:59 -05:00
Raymond Hill
1052dc5001
Import translation work from https://crowdin.com/project/ublock
2022-11-13 11:36:31 -05:00
Raymond Hill
4a01affa0e
Undo mistakenly committed changes to the element picker
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2360
2022-11-13 11:07:41 -05:00
Raymond Hill
73c2decdf5
Ensure procedural filters are applied at least once
...
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2261#discussioncomment-4123057
Cosmetic filters will be applied unconditionally at least
once at DOMContentLoaded time.
2022-11-12 11:22:49 -05:00
Raymond Hill
3d24b89078
Fix dom.text() returning textContent
2022-11-12 10:35:40 -05:00
Raymond Hill
feaa338678
Code maintenance: replace uDom.js with dom.js
...
`uDom` is old and crusty and `dom` is meant as replacement. The
goal of `dom` is to be simpler and mainly just convenience
methods for handling the DOM with vanilla JS -- this is not a
framework.
Additionally, removed keyboard shortcuts pane which was useful
only on very old versions of Firefox.
2022-11-12 09:51:22 -05:00
Raymond Hill
b1a14794bf
Test for unsupported pseudo operators after normalization
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2356
2022-11-10 10:32:22 -05:00
Raymond Hill
20181e9f18
Properly detect unsupported pseudo operators
...
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/yr8eda/
2022-11-10 09:30:52 -05:00
Raymond Hill
4d4a5f3807
Mind implicit prelude *
element in pseudo operators
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2355
2022-11-10 08:47:54 -05:00
Raymond Hill
8a34425ca5
Avoid redundant logger entries for scriptlet injection
...
Report only when the scriptlets have been successfully injected.
2022-11-06 17:23:06 -05:00
Raymond Hill
c65114ee5e
Add support for Belarusian language
2022-11-06 17:04:56 -05:00
Raymond Hill
49df063191
Try to inject scriptlets at onResponseStarted() time
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2350
As per AdGuard findings, it's possible (though unreliable) to try
to inject scriptlets at webRequest.onResponseStarted time, which
increases scriptlet injection reliability overall when injecting
from multiple entry points.
uBO was already injecting at webNavigation.onCommitted and
main content script time, and adding webRequest.onResponseStarted
as an entry point for scriptlet injection increases reliability
for webpages which executes inline scripts at the top of the DOM.
References:
- https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1029
- https://github.com/AdguardTeam/AdguardBrowserExtension/blob/9ab85be5/Extension/src/background/webrequest.js#L620
2022-11-06 16:54:32 -05:00
Raymond Hill
e0e68a24d2
Import translation work from https://crowdin.com/project/ublock
2022-11-06 13:11:23 -05:00
Raymond Hill
6574ede152
[mv3] Do not merge rules with errors
...
Related issue:
- https://github.com/uBlockOrigin/uBOL-issues/issues/10#issuecomment-1304822579
2022-11-06 11:21:02 -05:00
Raymond Hill
36bfa27c30
Rearrange code flow
2022-11-04 11:08:41 -04:00
Raymond Hill
c3d0d574d7
Fix incorrect serialization of pseudo elements
...
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/ylnvwf/how_to_block_suggestive_keyword_in_reddit_search/iv014wu/
2022-11-04 10:55:10 -04:00
Raymond Hill
42ddac5e3d
Fix unescaped backslashes in selector attribute
...
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/yjoh9p/
2022-11-02 08:32:54 -04:00
Raymond Hill
4863f3093e
Do not inject scriptlets on navigation events in Firefox
...
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2343
2022-10-28 11:07:46 -04:00
Raymond Hill
d992824625
Just to be sure no race condition
...
Related commit:
- d1f8a05d2d
2022-10-27 16:28:55 -04:00
Raymond Hill
d1f8a05d2d
Further ensure scriptlets are actually injected
...
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/ye6abt/
Possibly because the Opera sidebar window is a special
case, it appears the scriptlets must be injected at a
later time.
Use a global isolated window variable to detect whether
the scriptlets have really be injected, and ultimately
inject them at main content script time when it is found
they haven't been injected at that point.
2022-10-27 15:52:03 -04:00
Raymond Hill
bccd5a0264
Harden scriptlet injections
...
This commit make it so scriptlet injections will occur
at the earliest possible time on all platform.
This should also fix the case reported at:
- https://www.reddit.com/r/uBlockOrigin/comments/ye6abt/
Which is caused by the fact that there is no webNavigation
events being fired by the browser. In such case, the changes
here will make it so that uBO will detect that the scriptlet
were not injected and will inject them at main content script
injection time.
2022-10-27 14:16:21 -04:00