1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-01 16:49:39 +02:00
Commit Graph

4299 Commits

Author SHA1 Message Date
Raymond Hill
0bd4b600cf
Rework nowoif scriptlet
New official name: `no-window-open-if`.

The pattern will now be matched against all arguments passed
to `window.open()`: all the arguments are joined as a single
space-spearated string, and the result is used as the target
for matching the pattern.

To enable logging, used the extra parameters approach, i.e.
`log, 1`, which should come after the positional arguments
`pattern`, `delay`, and `decoy`.
2023-06-17 11:53:08 -04:00
Raymond Hill
683888108c
Import translation work from https://crowdin.com/project/ublock 2023-06-16 11:38:31 -04:00
Raymond Hill
9f2bfecd27
Be more flexible when converting procedural to declarative
Allows for the selector part to come after :media-matches().
2023-06-16 09:55:17 -04:00
Raymond Hill
07fae6a0d1
Fix procedural to declarative conversion 2023-06-16 09:34:35 -04:00
Raymond Hill
e5bd7556d9
Can't have whitespace in network filter pattern
Related feedback:
- https://github.com/uBlockOrigin/uAssets/discussions/17538#discussioncomment-6137462
2023-06-15 09:12:06 -04:00
Raymond Hill
d590390431
[mv3] Properly compiled complex generic cosmetic filters
Related issue:
- https://github.com/uBlockOrigin/uBOL-issues/issues/47
2023-06-14 10:19:48 -04:00
Raymond Hill
a2b51a8f91
Import translation work from https://crowdin.com/project/ublock 2023-06-14 09:26:28 -04:00
Raymond Hill
d1525691f4
Remove unimportant information from troubleshooting information
This was added back then for the purpose of investigating the
following issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2604

No longer needed.
2023-06-11 09:58:12 -04:00
Raymond Hill
aa507924f3
Inform when filter lists are reloaded in logger
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2041#issuecomment-1585685791
2023-06-10 11:54:24 -04:00
Raymond Hill
2f0132c414
Import translation work from https://crowdin.com/project/ublock 2023-06-09 10:41:29 -04:00
Raymond Hill
500d4ebe39
Import translation work from https://crowdin.com/project/ublock 2023-06-06 13:54:30 -04:00
Raymond Hill
b163097399
[mv3] Extend scriplet filtering support to all scriptlets
Source code of scriplets is now fetched directly from uBO
project, so there is no longer the need to keep duplicate
versions of scriplet code.

All scriplet filters are now supported.
2023-06-02 17:04:15 -04:00
Raymond Hill
cb9a91d43c
Fix comment 2023-06-01 08:56:42 -04:00
Raymond Hill
40141e2dfc
Fix assembling of scriptlets for isolated world 2023-06-01 08:48:27 -04:00
Raymond Hill
c642541cc4
Minor fine tuning 2023-05-29 07:34:54 -04:00
Raymond Hill
fa9fdc0922
Import translation work from https://crowdin.com/project/ublock 2023-05-28 12:47:41 -04:00
Raymond Hill
695b93f970
Add support for world/dependencies to external scriplets
To let community better experiment with potential candidate scriptlets
for inclusion in uBO itself.
2023-05-28 12:42:47 -04:00
Raymond Hill
d776edf06b
Fix linter incorrectly reporting header= option
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/13thksi/filter_blocking_rule_based_on_post_methods_value/jlvhuoy/
2023-05-27 19:02:23 -04:00
Raymond Hill
ea15cef524
[mv3] Also log salvaged rules using entity-based domains
Some filters with entity-based domain option can be salvaged
when there are non-entity-based domain option, but since we are
throwing away the entity-based entries, we are only partially
converting to DNR. This commit will log a warning about this
in log.txt. Before this commit, only non-salvageable filters
were logged.
2023-05-26 13:18:20 -04:00
Raymond Hill
1ff31e0ccd
Expand "uBlock filters" by default 2023-05-24 20:12:28 -04:00
Raymond Hill
3e082c44ca
Import translation work from https://crowdin.com/project/ublock 2023-05-24 15:36:04 -04:00
Raymond Hill
c622298793
Minor CSS tuning 2023-05-23 12:06:19 -04:00
Raymond Hill
947d45be2f
Include imported lists in request to update
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2582#discussioncomment-5969939
2023-05-23 12:04:47 -04:00
Raymond Hill
d74c73e452
Import translation work from https://crowdin.com/project/ublock 2023-05-23 09:28:36 -04:00
Raymond Hill
f18071fd26
Flags: w40 => h48, probably better for UHD displays 2023-05-23 09:24:30 -04:00
Raymond Hill
1a863a877d
Support injecting scriptlet in MAIN or ISOLATED world
This reflects the _world_ of the MV3 scripting API:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/scripting/ExecutionWorld

MAIN: page's world
ISOLATED: extension's content script world

Some scriptlets are best executed in either world, so this
commit allows to pick in which world a scriptlet should execute
(default to MAIN).

For instance, the new sed.js scriptlet will now execute in
the ISOLATED world.
2023-05-22 20:19:00 -04:00
Raymond Hill
23ec2541ef
Prefix lists with ccTLDs instead of 3-letter country codes
ccTLDs are more relatable websites loaded in the browser.
2023-05-21 21:08:29 -04:00
Raymond Hill
41876336db
Add trusted-source support for privileged scriptlets
At the moment, the only filter lists deemed from a "trusted source"
are uBO-specific filter lists (i.e. "uBlock filters -- ..."), and
the user's own filters from "My filters".

A new scriptlet which can only be used by filter lists from trusted
sources has been introduced: `sed.js`.

The new `sed.js` scriptlet provides the ability to perform
text-level substitutions. Usage:

    example.org##+js(sed, nodeName, pattern, replacement, ...)

`nodeName`

The name of the node for which the text content must be substituted.
Valid node names can be found at:
https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName

`pattern`

A string or regex to find in the text content of the node as the target of
substitution.

`replacement`

The replacement text. Can be omitted if the goal is to delete the text which
matches the pattern. Cannot be omitted if extra pairs of parameters have to be
used (see below).

Optionally, extra pairs of parameters to modify the behavior of the scriptlet:

`condition, pattern`

A string or regex which must be found in the text content of the node
in order for the substitution to occur.

`sedCount, n`

This will cause the scriptlet to stop after n instances of substitution. Since
a mutation oberver is used by the scriptlet, it's advised to stop it whenever
it becomes pointless. Default to zero, which means the scriptlet never stops.

`tryCount, n`

This will cause the scriptlet to stop after n instances of mutation observer
run (regardless of whether a substitution occurred). Default to zero, which
means the scriptlet never stops.

`log, 1`

This will cause the scriptlet to output information at the console, useful as
a debugging tool for filter authors. The logging ability is supported only
in the dev build of uBO.

Examples of usage:

    example.com##+js(sed, script, /devtoolsDetector\.launch\(\)\;/, , sedCount, 1)

    example.com##+js(sed, #text, /^Advertisement$/)
2023-05-21 14:16:56 -04:00
Raymond Hill
2c7d91ba57
Minor change to regex 2023-05-21 09:45:46 -04:00
Raymond Hill
e50d6ee6ed
Fix sorting of lists in "Filter lists" pane
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2645#issuecomment-1556090600
2023-05-21 09:42:30 -04:00
Raymond Hill
d506b28a48
Patch Unicode country flags with image-based flags
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2645
2023-05-20 21:35:52 -04:00
Raymond Hill
437889e309
Import translation work from https://crowdin.com/project/ublock 2023-05-20 17:31:01 -04:00
Raymond Hill
ae52ca43c2
Import translation work from https://crowdin.com/project/ublock 2023-05-19 13:06:38 -04:00
Raymond Hill
0442718efd
Render List stats below on mobile 2023-05-17 15:45:31 -04:00
Raymond Hill
df5437a54f
Revert "Render List stats below on mobile"
This reverts commit 9ea39886b6.
2023-05-17 15:44:11 -04:00
Raymond Hill
03a1009b07
As per feedback on https://crowdin.com/project/ublock 2023-05-17 10:27:10 -04:00
Raymond Hill
07845196b7
Import translation work from https://crowdin.com/project/ublock 2023-05-17 10:25:27 -04:00
Raymond Hill
14637923fc
Fix remaining quirks in "Filter lists" pane
Do not sticky unchecked lists in search mode.

Propagate default status of a sublist upward to its parent
entry.
2023-05-17 10:05:19 -04:00
Raymond Hill
d6eacd8cf6
In search-mode, select only search-matched descendants
Context: "Filter lists" pane.
2023-05-17 09:21:14 -04:00
Raymond Hill
d515146d36
Import translation work from https://crowdin.com/project/ublock 2023-05-16 12:25:25 -04:00
Raymond Hill
af04821d7a
Rename "Malware domains" section to "Malware, security" 2023-05-16 12:23:41 -04:00
Raymond Hill
d27b3471e1
Import translation work from https://crowdin.com/project/ublock 2023-05-16 12:21:59 -04:00
Raymond Hill
9ea39886b6
Render List stats below on mobile 2023-05-16 12:10:40 -04:00
Raymond Hill
5ba3055bc7
Fix class name 2023-05-14 20:18:32 -04:00
Raymond Hill
5c5ccc78bc
Import translation work from https://crowdin.com/project/ublock 2023-05-14 10:07:36 -04:00
Raymond Hill
0b63a4c281
Minor code review 2023-05-14 10:05:42 -04:00
Raymond Hill
7bc06fec8c
Code maintenance: remove now unused ABP-related code path 2023-05-14 09:41:35 -04:00
Raymond Hill
a3a80e3b3f
Do not bail out when content-disposition is inline
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2656
2023-05-14 09:06:21 -04:00
Raymond Hill
1a9a8aae0c
Fix improperly unselecting imported lists
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/13enzvv/

When assessing which default lists to disable/enable after
updating from 1.48.x to 1.49.x, uBO has to ignore imported
lists, as these do not have a `off` property -- the
non-existence of this property was used to determine whether
a list was default or not. There needs to be an extra test for
whether the list is imported or not.
2023-05-11 11:46:31 -04:00
Raymond Hill
fc7b2898d2
Make list-search i18n aware where possible 2023-05-09 16:56:33 -04:00