Commit Graph

4475 Commits

Author SHA1 Message Date
Raymond Hill 4a570c151f
[mv3] Merge modifyHeaders rules where feasible 2023-07-10 13:13:20 -04:00
Raymond Hill ff7c3d0ad6
Add `permissions=` handling to built-in benchmark 2023-07-10 12:00:02 -04:00
Raymond Hill 0f6400c160
[mv3] Add support for `permissions=` filter option
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2714
2023-07-10 11:56:57 -04:00
Raymond Hill de5241ab36
[mv3] Reject filters with unsupported modifier options
For example, filters with `permissions` option.
2023-07-09 09:26:50 -04:00
Raymond Hill 5ebdbf3e24
Add static network filter option: `permissions`
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2714

Reference:
https://adguard.com/kb/general/ad-filtering/create-own-filters/#permissions-modifier

Example:

    ||example.org^$permissions=browsing-topics=()

Difference with AdGuard's syntax: use `|` to separate permissions
policy directives instead of `\,` -- uBO will replace instances
of `|` with `, `:

    *$permissions=oversized-images=()|unsized-media=()

Eventually uBO will support AdGuard's syntax of using escaped
commas, but not for this first iteration.
2023-07-09 08:03:47 -04:00
Raymond Hill 5739562d10
Use browser.storage.local API for Firefox + private mode
But only if the indexedDB is being created.

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2725
2023-07-06 19:58:05 -04:00
Raymond Hill 872eafa378
[mv3] Add support for highly generic cosmetic filters
Related issue:
- https://github.com/uBlockOrigin/uBOL-issues/issues/54
2023-07-06 15:45:45 -04:00
Raymond Hill 80b3f3c3c0
Fix regression in cloud storage import of "Filter lists" pane
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2721
2023-07-04 07:27:14 -04:00
Raymond Hill 60b21b1422
Prevent negative position when widget size is greater than viewport size
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2718
- https://github.com/uBlockOrigin/uBlock-issues/issues/2704
2023-07-03 07:14:52 -04:00
Raymond Hill e52da39839
Fine tune network filter option anchor detection
The change allows to better parse AdGuard filters with `replace=`
option when the value to the `replace=` option contains dollar
sign character `$`. uBO will still reject these filters but will
better identify which dollar sign `$` is the real filter option
anchor.
2023-07-03 06:54:46 -04:00
Raymond Hill 622cda2cdf
Add visual hint when not all sublists are enabled
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2687
2023-07-03 06:49:09 -04:00
Raymond Hill 44b281e517
Import translation work from https://crowdin.com/project/ublock 2023-07-01 10:33:02 -04:00
Raymond Hill 33b409dd5b
Add support for AdGuard's noop (`_`) network filter option
Reference:
- https://adguard.com/kb/general/ad-filtering/create-own-filters/#noop-modifier

uBO already supported the noop filter option `_` to allow filter
authors to resolve possible ambiguities arising when crafting network
filters with many options.

AdGuard extended the semantic of the `_` option to also resolve
readability issues by supporting multiple instances of the `_` option
in a single filter, and also by supporting any number of consecutive
`_` in a single noop filter option.
2023-06-30 16:09:21 -04:00
Raymond Hill b44815f0c8
Ensure no negative value for `top` property of floating widget in logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2704
2023-06-30 11:45:34 -04:00
Raymond Hill 5d6e103186
Add "tabless" filter expression for logger output
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2711
2023-06-29 15:12:22 -04:00
Raymond Hill 194354cd5d
Add support for logical expressions to `!#if` directive
Reference:
https://adguard.com/kb/general/ad-filtering/create-own-filters/#conditions-directive

This commit should make uBO fully compatible with the `!#if`
directives found throughout AdGuard's filter lists.

Additionally, added the new `!#else` directive for convenience
to filter list authors:

    !#if cap_html_filtering
    example.com##^script:has-text(fakeAd)
    !#else
    example.com##+js(rmnt, script, fakeAd)
    !#endif
2023-06-29 14:50:42 -04:00
Raymond Hill 9433b218f7
Remove obsolete code 2023-06-29 14:49:43 -04:00
Raymond Hill 7867c25128
Add resource aliases for increased compatibility with AdGuard lists 2023-06-29 14:48:43 -04:00
Raymond Hill c350e23b2d
Fix regression in parameters-passing in scriptlets 2023-06-29 09:05:48 -04:00
Raymond Hill de6b1d361d
Fix typo in new getScriptletArgs() method
Additionally, bring mv3 build up to date with latest changes
to scriptlet framework.
2023-06-28 20:05:59 -04:00
Raymond Hill fd036a51ee
Add compatibility with AdGuard's `#%#//scriptlet(...)` syntax
Related issue:
- https://github.com/AdguardTeam/Scriptlets/issues/332

Additionally, uBO's own scriplet syntax now also accept quoting
the parameters with either `'` or `"`. This can be used to avoid
having to escape commas when they are present in a parameter.
2023-06-28 19:35:22 -04:00
Raymond Hill 8b7a5264de
Fix syntax highlighter throwing with invalid patterns
The syntax highlighter could throw with some invalid static
network filter patterns. This was caused by the syntax
highlighter still drilling down the pattern parts after
having told codemirror to style the whole pattern as an
error, thus causing the codemirror stream position to go
backward.
2023-06-28 08:38:47 -04:00
Raymond Hill 7184f93cb0
Return empty array instead of undefined
Related discussion:
- https://github.com/uBlockOrigin/uAssets/discussions/18649
2023-06-23 20:42:58 -04:00
Raymond Hill 7ba85472d7
[mv3] Properly distinguish trust level when compiling scriptlets
Since in uBOL filter lists from various sources are combined into
a single list, there must be a way to turn on/off trust level
inside the resulting combined filter list so as to be able to
validate the trust level of filters requiring trust.

This commit adds new parser directives understood only by MV3
compiler to turn on/off trust flag internally.
2023-06-23 08:27:07 -04:00
Raymond Hill e50b391105
Prevent creating report until filter lists are updated
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2582#discussioncomment-6187066
2023-06-22 14:36:12 -04:00
Raymond Hill f6954430d1
Add support for sublist at any tree depth in "Filter lists" pane 2023-06-21 09:11:21 -04:00
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
Raymond Hill 578fc21bd9
Report injected scriptlets in troubleshooting information
This requires to rewrite portions of scriptlet filtering
code.
2023-05-09 12:44:14 -04:00
Raymond Hill fd821e3473
Force all dev builds to use assets.dev.json 2023-05-08 08:23:19 -04:00
Raymond Hill f6839f5a57
Keep reflecting search matches after applying changes 2023-05-08 07:08:45 -04:00
Raymond Hill 9808423845
Bring back list-per-group counts
Regression from:
- cbc0cbadaa
2023-05-07 19:07:21 -04:00
Raymond Hill 56092189d1
Fix rendering issue of row-filter icon in popup panel
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2640
2023-05-07 10:42:30 -04:00
Raymond Hill 88fb6b153d
Add "scriptlet" filter expression to logger
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2636
2023-05-07 09:35:48 -04:00
Raymond Hill a6b13e6b9c
Fix hostname-detecting regex
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2639
2023-05-07 09:19:39 -04:00
Raymond Hill bc02358610
Use a different surface color for scriptlets in logger
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2636
2023-05-06 18:56:00 -04:00
Raymond Hill 7f9c4ce45f
Import translation work from https://crowdin.com/project/ublock 2023-05-06 17:26:19 -04:00
Raymond Hill cbc0cbadaa
Fix bad filter counts 2023-05-06 17:08:55 -04:00
Raymond Hill 84fad1deeb
Add support for sublists in "Filter lists" pane
As discussed internally with filter list maintainers.

Additionally, added a search field to filter out lists. This
is still a work in progress, no need to open issues about this,
I am aware of what is missing (i18n, more tags, etc.)
2023-05-06 12:50:25 -04:00
Raymond Hill 223815342e
Make dev build use its own assets.json: assets.dev.json
This will make it easier to safely test new versions of
assets.json.
2023-05-04 19:20:18 -04:00
Raymond Hill 2059f84826
Fine tune CSS in asset viewer for mobile
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2621#issuecomment-1529036289
2023-04-30 11:56:31 -04:00
Raymond Hill 5fd35ffb3c
Properly handle converted procedural filters in logger
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2624
2023-04-29 15:22:40 -04:00
Raymond Hill 536bfb3387
Reminder that `typeof null` is 'object'
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2619#discussioncomment-5757274
2023-04-28 16:59:14 -04:00
Raymond Hill c31e087946
Mind small screen size in asset viewer
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2621
2023-04-28 16:57:06 -04:00
Raymond Hill 6d81614bd8
Fix and fine tune "Report a filter issue" page
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2619
2023-04-28 08:38:26 -04:00
Raymond Hill ca2b016ee9
Warn against missing argument in linter 2023-04-28 07:59:50 -04:00
Raymond Hill 2e465d48c0
Improve rendering of troubleshooting info 2023-04-27 19:16:46 -04:00
Raymond Hill ad969ec153
Import translation work from https://crowdin.com/project/ublock 2023-04-27 08:52:32 -04:00
Raymond Hill 354c060346
Minor HTML/CSS changes 2023-04-27 08:49:45 -04:00
Raymond Hill 8b1b8c4c7f
Fix test in last commit 2023-04-26 20:55:57 -04:00
Raymond Hill b870c94651
Use in-memory availableFilterLists if populated 2023-04-26 20:52:39 -04:00
Raymond Hill b8cfa382e8
Move hostname label to top
Related feedback:
- https://twitter.com/gorhill/status/1650912124003139599
2023-04-26 14:01:16 -04:00
Raymond Hill 2f387e8820
Import translation work from https://crowdin.com/project/ublock 2023-04-26 08:08:16 -04:00
Raymond Hill 348f75af7f
Reverse usage of `browser.alarms`
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2604

Related commit:
- bec6cad2c0
2023-04-26 08:00:13 -04:00
Raymond Hill ef825245b9
Simplify lz4 instance management 2023-04-25 22:14:15 -04:00
Raymond Hill 1ffdb7d948
Various minor code review 2023-04-25 21:15:11 -04:00
Raymond Hill ae474aae40
Remove languages with no translations, no activity 2023-04-25 14:21:46 -04:00
Raymond Hill 7e894f5e0e
Add time since version update in troubleshooting info 2023-04-25 14:01:47 -04:00
Raymond Hill 5e174c6cb5
Import translation work from https://crowdin.com/project/ublock 2023-04-25 11:09:33 -04:00
Raymond Hill c729ac5717
Fix inaccurate description, as per feedback 2023-04-25 11:07:54 -04:00
Raymond Hill 96b3ae5e87
Import translation work from https://crowdin.com/project/ublock 2023-04-25 11:06:53 -04:00
Raymond Hill c3fc7636f2
Add missing period (as suggested by Crowdin volunteer) 2023-04-24 12:09:26 -04:00
Raymond Hill bf53737db4
Import translation work from https://crowdin.com/project/ublock 2023-04-24 09:47:59 -04:00
Raymond Hill ec70f1d99e
Unconditionally listen to listset changes 2023-04-24 09:38:37 -04:00
Raymond Hill 34d2a4ea2a
Fix slice size
Related feedback:
ec4480e122 (r110292487)
2023-04-24 09:18:26 -04:00
Raymond Hill e46705db00
Listen to all-filter-lists-reloaded, not all-assets-updated
Related commit:
- 4a92f96206
2023-04-23 16:32:38 -04:00
Raymond Hill 537d6c6b89
Import translation work from https://crowdin.com/project/ublock 2023-04-23 13:51:10 -04:00
Raymond Hill 4a92f96206
Offer opportunity to update filter lists before reporting issue
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2582

If there exist any built-in filter list which last update time
is older than 2 hours, the "Report a filter issue" page will ask
the user to update their filter lists then verify that the issue
still exists.

Once filter lists are updated, the troubleshooting information
will reflect the change in update time.
2023-04-23 13:45:11 -04:00
Raymond Hill ec4480e122
Fine tune troubleshooting information 2023-04-23 10:22:46 -04:00
Raymond Hill a2725cb987
Import translation work from https://crowdin.com/project/ublock 2023-04-22 19:34:26 -04:00
Raymond Hill 98d4d24f9b
Mind rejected promises from vAPI.storage API
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2604
2023-04-22 19:29:54 -04:00
Raymond Hill 54cb5e2232
Properly handle promise rejection from webext.storage.local() API
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2604
2023-04-22 10:57:10 -04:00
Raymond Hill 6294829e68
Add more checks against unexpected conditions re. assets.json 2023-04-21 20:28:49 -04:00
Raymond Hill 3dddf4ca47
Fix compiling of negated regex-based `to=` domain
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2234#discussioncomment-5655665
2023-04-19 07:40:12 -04:00
Raymond Hill e642195d4c
import translation work from https://crowdin.com/project/ublock 2023-04-18 11:12:28 -04:00
Raymond Hill f539f869b9
Fix counting of error deletion in linter
Related feedback:
- https://github.com/uBlockOrigin/uAssets/discussions/17538#discussioncomment-5628053
2023-04-16 08:23:49 -04:00
Raymond Hill e15951dce5
Convert remaining vAPI.setTimeout to vAPI.defer
Related commit:
- 91f9795023
2023-04-14 10:26:45 -04:00
Raymond Hill 19db4e57f2
Make the toolbar warning timeout configurable
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2589
2023-04-14 09:55:06 -04:00
Raymond Hill 7347a2148a
No need for async 2023-04-13 22:24:49 -04:00
Raymond Hill 986ea0691d
Use Promise the way they are meant to be used 2023-04-13 15:03:19 -04:00
Raymond Hill c97d0ab062
Forcefully clear unprocessed-request status after a minute
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2589#issuecomment-1507084473
2023-04-13 11:41:52 -04:00
Raymond Hill b6a5424c8d
Seems to fix search count not showing 2023-04-12 20:54:43 -04:00
Raymond Hill bc54179edd
More aggressively clear the unprocessed-request status
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2589
2023-04-12 10:55:00 -04:00
Raymond Hill f661196691
Revert vandalism in Czech translation from https://crowdin.com/project/ublock 2023-04-12 09:30:06 -04:00
Raymond Hill 9b3bc3874b
Import translation work from https://crowdin.com/project/ublock 2023-04-12 08:55:54 -04:00
Raymond Hill 464119af61
Link the reload button to clearing the unprocessed-requests status 2023-04-11 23:28:27 -04:00
Raymond Hill be736b20bd
Search style should override error style 2023-04-11 22:40:44 -04:00
Raymond Hill 6f3b5df8ef
Fix errand change re. new setTimeout wrapper 2023-04-11 10:33:21 -04:00
Raymond Hill 73a63b1930
Import translation work from https://crowdin.com/project/ublock 2023-04-11 08:46:14 -04:00
Raymond Hill f0c28f2faa
Minor CSS change 2023-04-10 19:54:16 -04:00
Raymond Hill a495dabff9
Import translation work from https://crowdin.com/project/ublock 2023-04-10 19:37:32 -04:00
Raymond Hill bf5f343548
Replace toolbar icon tooltip with message section in panel
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2585

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/126rn4f/yellow_toolbar_icon_exclamation_mark_badge/jfns0pc/
2023-04-10 17:10:00 -04:00
Raymond Hill dad862f063
Properly detect incorrect usage of CSS combinators
Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/12fquk4/ublock_is_on_but_im_still_getting_ads_on_this/jfpkz1g/
2023-04-10 15:13:03 -04:00
Raymond Hill 768bf7d6f6
Import translation work from https://crowdin.com/project/ublock 2023-04-10 10:22:17 -04:00
Raymond Hill 63d0f124ba
Replace requestIdleCallback() with new vAPI.defer utility
Related commit:
- 91f9795023
2023-04-10 10:10:19 -04:00
Raymond Hill 3b14fd915a
Fix cloud storage widget not showing (regression)
Related feedback:
- 50afd5ae38 (commitcomment-108294887)
2023-04-10 10:03:51 -04:00
Raymond Hill 0a1deffb02
Add missing period, as suggested 2023-04-10 08:16:01 -04:00
Raymond Hill 5baced053a
Import translation work from https://crowdin.com/project/ublock 2023-04-09 18:48:49 -04:00
Raymond Hill fe45a0dd77
Import translation work from https://crowdin.com/project/ublock 2023-04-09 14:04:42 -04:00
Raymond Hill 3530b9dc89
Add informative tooltip re. unprocessed requests at launch
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2585
2023-04-09 14:02:01 -04:00
Raymond Hill c5d62d9ae7
Import translation work from https://crowdin.com/project/ublock 2023-04-09 14:00:39 -04:00
Raymond Hill 91f9795023
Wrap usage of setTimeout in helper for background + auxiliary pages
This commit centralizes usage of setTimeout()/clearTimeout() in the
source code at one single location.
2023-04-09 13:38:16 -04:00
Raymond Hill bec6cad2c0
Start using browser.alarms instead of setTimeout() where applicable
Related documentation:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Background_scripts#convert_to_non-persistent
2023-04-07 20:24:20 -04:00
Raymond Hill 66c70cf746
Fix improper detection of quotes in quoted strings
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2586
2023-04-07 18:10:50 -04:00
Raymond Hill 8b5774a83d
Minor CSS tweak 2023-04-06 17:43:03 -04:00
Raymond Hill f2698b097c
Fix mv3 build 2023-04-06 17:42:21 -04:00
Raymond Hill b2894756e5
Import translation work from https://crowdin.com/project/ublock 2023-04-06 13:22:48 -04:00
Raymond Hill bc21a1fe72
Use custom linter gutter as container for code-folding widgets
This allows to reduce the horizontal size of the gutter; more efficient
management of folding since we already need to parse each line for the
linter; and eventually this will also allows to detect unbalanced
!#if-!#endif directives and report such cases as errors.

Additionally, keep incrementally improving error reporting details
in the linter.
2023-04-06 13:14:42 -04:00
Raymond Hill 028eee456f
Ensure error count is decrease when an error is fixed 2023-04-04 16:55:47 -04:00
Raymond Hill d59eeba8e2
Fix tabs.executeScript() not resolving in due time
Related feedback:
- 6efd8eb84a
2023-04-04 14:28:48 -04:00
Raymond Hill 0f5384ee0d
Rename reported popup panel property 2023-04-04 13:42:09 -04:00
Raymond Hill 620a96531c
Report cosmetic filters as popup panel property 2023-04-04 13:20:58 -04:00
Raymond Hill 6efd8eb84a
Add matched cosmetic filters in troubleshooting information 2023-04-04 11:15:44 -04:00
Raymond Hill 09265ef57c
Simplify linter error counting by using line events 2023-04-04 09:24:18 -04:00
Raymond Hill 9b5ed5ca86
Fine-tune underline styles used in CM editor 2023-04-04 08:36:44 -04:00
Raymond Hill 3e1030588e
Import translation work from https://crowdin.com/project/ublock 2023-04-03 10:24:47 -04:00
Raymond Hill 4aea9aa624
Better folding arrows in CodeMirror editor 2023-04-03 10:20:53 -04:00
Raymond Hill 6e8aeae283
Flush memory cache at key filtering profile changes
To reduce the need for hard reload after changes in filters,
rules.
2023-04-03 10:19:06 -04:00
Raymond Hill 6531b86d29
Fix search highlight with dark theme
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2542#discussioncomment-5502579
2023-04-02 13:20:22 -04:00
Raymond Hill ae1afe0381
Import translation work from https://crowdin.com/project/ublock 2023-04-02 12:13:44 -04:00
Raymond Hill edbe96a401
Add logging ability to `acs` scriptlet, for the benefit of filter list
maintainers.

To enable logging, use the JSON approach to pass parameters to
`acs` scriptlet. Example:

    ..##+js(acs, { "target": "document.oncontextmenu", "log": true })

Whereas "target", "needle", and "context" correspond to their
respective positional argument. Using JSON form to pass parameters
allows to specify extra paramters to facilitate debugging of that
scriptlet:

- `"log": true` => output useful information at the dev console.
- `"debug": true` => break at key locations in the scriptlet.

The added logging/debugging capabilities work only in the dev build
of uBO or if the advanced setting `filterAuthorMode` is set to
`true`.
2023-04-02 12:01:58 -04:00
Raymond Hill 95bd52d01f
Fine tuning new linter code 2023-04-02 10:40:44 -04:00
Raymond Hill cda39709b1
Properly fail on bad network filter pattern
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1146
2023-04-02 10:05:42 -04:00
Raymond Hill 46e90b21e9
Code review of new linter code
As per CodeMirror's documentation, eachLine() iterator is
faster, so use this. Also no need to keep track or marked
lines, we can just find them on demand, this makes the code
simpler.
2023-04-02 09:19:32 -04:00
Raymond Hill dd8031a508
Fine tune CSS style for errors 2023-04-01 18:11:41 -04:00
Raymond Hill 0601350995
Import translation work from https://crowdin.com/project/ublock 2023-04-01 16:51:03 -04:00
Raymond Hill 9519666fcc
Import translation work from https://crowdin.com/project/ublock 2023-04-01 16:49:15 -04:00
Raymond Hill 50afd5ae38
Add infrastructure for static filter syntax linter
Sort of related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1134
2023-04-01 16:42:41 -04:00
Raymond Hill b10f15dd89
Ignore line, do not report as error
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2560#issuecomment-1492959500
2023-04-01 13:50:53 -04:00
Raymond Hill e2d837a2db
Fix presumed network filter not being a valid network filter
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2560#issuecomment-1492959500
2023-04-01 09:05:36 -04:00
Raymond Hill 9f1c0d986b
Add support to restore from `json` file
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1956
2023-03-31 09:58:50 -04:00
Raymond Hill 0d26064a26
Make `object` equivalent of `frame` for dynamic filtering purpose
Related issue:
- uBlockOrigin/uBlock-issues#2496
2023-03-31 09:46:22 -04:00
Raymond Hill b4ae2d3bf4
Make `object` equivalent of `frame` for dynamic filtering purpose
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2496
2023-03-31 09:37:53 -04:00
Raymond Hill 0d5cb8cff5
Import translation work from https://crowdin.com/project/ublock 2023-03-31 08:49:00 -04:00
Raymond Hill e2a158d94b
Add check before accessing vAPI 2023-03-31 08:28:09 -04:00
Raymond Hill 5c85fdbc32
Fix typo in code
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2570#issuecomment-1491616007
2023-03-31 08:26:53 -04:00
Raymond Hill b5d78a07bf
Fix type in variable name
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2570
2023-03-30 20:46:44 -04:00
Raymond Hill a6071565a5
Import translation work from https://crowdin.com/project/ublock 2023-03-30 16:35:52 -04:00
Raymond Hill 0a899e1279
Added strings to translate 2023-03-30 16:33:32 -04:00
Raymond Hill c3df4ced0a
Import translation work from https://crowdin.com/project/ublock 2023-03-30 16:32:24 -04:00
Raymond Hill d58309674d
Enfore implicit `media` type for filters using `mp4`
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2568
2023-03-30 13:25:45 -04:00
Raymond Hill 42a00ec742
Better detect invalid network filter patterns
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2566
2023-03-30 12:58:19 -04:00
Raymond Hill 1835e90125
Avoid using `!` toolbar icon badge when inconsequential
uBO will now verify that at least one unprocessed network requests
at launch should have been blocked in order to warn users of
unprocessed network requests through the `!` toolbar icon badge.

For example, with default filter lists, there is nothing to block
on `wikipedia.org`, and hence in this case it's not useful to
present the user with the `!` badge.

Therefore uBO will not show the badge *only* when at least one
unprocessed network requests should have been blocked had uBO been
ready when it was fired by the browser.

Related commit:
- https://github.com/gorhill/uBlock/commit/769b8da664be
2023-03-30 12:30:44 -04:00
Raymond Hill 3d1c696e20
Support view source of "other" type 2023-03-30 12:29:02 -04:00
Raymond Hill 08d411a7b4
Clear network error status when list fetch succeed 2023-03-30 12:28:02 -04:00
Raymond Hill 6461393b6a
Prevent repeatedly launching emergency updates
Emergency update of assets could be repeatedly launched
every 15 seconds if a resource could not be fetched from
a server. A cooldown period has been added to prevent
repeatedly launching emergency updates.
2023-03-29 13:02:48 -04:00
Raymond Hill 8d445e782d
Add widget to filter firewall rows in popup panel
This replaces the limited "visually enhance rows" togglers.
2023-03-29 12:47:18 -04:00
Raymond Hill 189bdd685f
Properly report network error condition when importing filter list
Before this commit, a network error condition was not reported
when the filter list was imported, it was only reported afterward
when the imported filter list was updated.
2023-03-28 09:54:03 -04:00
Raymond Hill 391b2a4e67
Test for presence of vAPI in deferred methods 2023-03-28 08:39:36 -04:00
Raymond Hill 198c20db76
Return error when GET returns a non-plain text file 2023-03-28 08:38:34 -04:00
Raymond Hill 8507d637e5
Add support for negated hostnames in HTML filters
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/6
2023-03-28 08:35:09 -04:00
Raymond Hill 3658d70cc4
Add missing 64px icons 2023-03-27 18:18:21 -04:00