Commit Graph

4774 Commits

Author SHA1 Message Date
Raymond Hill 3b4f02db21
Add a console pane to the logger
The console pane will report logging information reported by
scriptlets.

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3096#discussioncomment-8748932

Plus other changes.
2024-04-10 11:27:40 -04:00
Raymond Hill c0b56cffab
Improve suggested candidate filters in element picker
Additionally, fix eslint warnings.
2024-04-10 10:28:11 -04:00
Raymond Hill 581c2824d0
Minor code review 2024-04-09 20:05:53 -04:00
Raymond Hill a5f6c35bb0
Fix bad date computation in auto-comment feature
Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/1bxz6oi/
2024-04-09 12:15:03 -04:00
Raymond Hill c223a8cd39
Fix regression breaking import of `file://` lists
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3199
2024-04-08 20:48:58 -04:00
Raymond Hill e7951c2114
Import translation work from https://crowdin.com/project/ublock 2024-04-08 08:23:48 -04:00
Raymond Hill defd68ef7d
Fix stray lists in redesigned cache storage
Related issue:
https://old.reddit.com/r/uBlockOrigin/comments/1bxzwf9/

These stray filter lists prevents uBO from properly updating
those filter lists.
2024-04-07 18:21:37 -04:00
Raymond Hill 4533f0e37e
Fix eslint warnings 2024-04-03 10:22:57 -04:00
Raymond Hill 7ca3855395
Import translation work from https://crowdin.com/project/ublock 2024-04-01 08:33:56 -04:00
Raymond Hill 08aa3ebe10
Fix eslint warnings 2024-03-31 13:35:11 -04:00
Raymond Hill 08b8b875ca
Import translation work from https://crowdin.com/project/ublock 2024-03-29 09:26:56 -04:00
Raymond Hill d3fe073149
Import translation work from https://crowdin.com/project/ublock 2024-03-28 08:21:46 -04:00
Raymond Hill 3919a16bb8
Do not block large media resources when loaded as top-level document
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1201
- https://github.com/uBlockOrigin/uBlock-issues/issues/3184

Top-level media resources are not meant to be blocked, see:
https://github.com/gorhill/uBlock/issues/2813#issuecomment-317177212
2024-03-26 12:44:08 -04:00
Raymond Hill 90ab1a76ab
Properly manage cache storage regarding managed user filters
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3177
2024-03-23 13:28:18 -04:00
Raymond Hill 47ae87724a
Import translation work from https://crowdin.com/project/ublock 2024-03-22 14:53:22 -04:00
Raymond Hill 5d60df4b1b
Fix bad eslint rule + minor code review
`webext.js` module needs to be explicitly imported.

Added time-based heuristic to decide when a webpage loses
communication with background process.
2024-03-22 14:46:57 -04:00
Raymond Hill d368747235
Import translation work from https://crowdin.com/project/ublock 2024-03-22 09:49:42 -04:00
Raymond Hill 62965cd34f
Import translation work from https://crowdin.com/project/ublock 2024-03-21 13:55:53 -04:00
Raymond Hill 61e916901b
Add concept of "preferred" lists
Preferred lists will be visually listed above other lists.
2024-03-19 11:51:03 -04:00
Raymond Hill 7e48a03927
Make syntax errors more visible
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/992#issuecomment-2002586019
2024-03-19 11:39:07 -04:00
Raymond Hill 0cb6170584
Fix various quirks with "My filters" trust-related checkbox
Simplify code to force syntax highlighter and linter to reprocess
the content when toggling trust-related checkbox.

Fix issue with using `mousedown` on searchbar widgets, related
feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3161#issuecomment-2002112770

Fix issues reported by eslint.
2024-03-19 10:59:15 -04:00
Imre Kristoffer Eilertsen 499c80bd8a
Fixed Belgian and Nepali flags for Windows Chromium users (#3914)
* Added flagcode matching for Belgium specifically

* Added a transparent Nepal flag
2024-03-17 10:42:20 -04:00
Raymond Hill 42dfdfea5d
Fix regression in visual of document-blocked page
Related commit:
46ea5519c1
2024-03-17 09:40:59 -04:00
Raymond Hill 94de4e266e
Fix popup panel when embedded in logger
Regression from commit:
https://github.com/gorhill/uBlock/commit/0d77ccded7

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2419#discussioncomment-8759449
2024-03-17 09:36:39 -04:00
Raymond Hill 3f7374c1f1
Mind that `tabs.sendMessage` can throw 2024-03-17 09:34:05 -04:00
Raymond Hill 1cb190e102
Append wildcard character only when filter starts & ends with `/`
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/1088
2024-03-14 13:32:36 -04:00
Raymond Hill 65b6753c69
Simpler to use an extra property than to use a new assets.json 2024-03-14 10:20:25 -04:00
Raymond Hill 8165067b9b
Act on default mouse button 2024-03-14 09:14:15 -04:00
Raymond Hill 67a653046d
Import translation work from https://crowdin.com/project/ublock 2024-03-13 14:39:55 -04:00
Raymond Hill 52b46eb98b
Add procedural operator `:shadow()` -- status is experimental
For internal use by filter list maintainers, do not open issues
about this. Left undocumented on purpose.

This new procedural operator allows to target elements in the
shadow root of an element.

subject:shadow(arg)

- Description: Look-up matching elements inside the shadow root (if
  present) of _subject_.
- Chainable: Yes
- _subject_: Can be a plain or procedural selector.
- _arg_: A plain or a procedural selector for the elements to target
  inside the shadowroot.

Example:

..##body > div:not([class]):shadow(div[style]):has(:shadow([data-i18n^="#ad"]))
2024-03-13 14:28:53 -04:00
Raymond Hill 6f54317bdf
Keep search input field visuals consistent
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3161#issuecomment-1992340127
2024-03-13 10:57:56 -04:00
Raymond Hill df5a6d1fcc
Constant name consistency 2024-03-13 10:03:05 -04:00
Raymond Hill 664dd95700
Support maximizing editor to viewport size
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3161#issuecomment-1991066618
2024-03-12 11:25:50 -04:00
Raymond Hill 710d8c6494
Import translation work from https://crowdin.com/project/ublock 2024-03-12 10:08:22 -04:00
Raymond Hill 633135745f
Need new `assets.son` file for next release
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3154
2024-03-11 18:41:18 -04:00
Raymond Hill 461810d93c
Rename `scuo-` to `s14e-` 2024-03-11 15:40:50 -04:00
Raymond Hill 0332bf163c
Import translation work from https://crowdin.com/project/ublock 2024-03-11 13:29:30 -04:00
Raymond Hill 0d77ccded7
Add advanced setting to force popup panel orientation
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2419#discussioncomment-8746679

Name: `popupPanelOrientation`

Supported values:
- `unset` (default): uBO decides whichever mode is best
- `landscape`: force popup panel to landscape mode
- `portrait`: force popup panel to portrait mode
2024-03-11 13:01:51 -04:00
Raymond Hill 46ea5519c1
Add checkboxes to "My filters" pane
Related issues:
- https://github.com/uBlockOrigin/uBlock-issues/issues/3161
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2895#discussioncomment-8504374

Two checkboxes have been added to the "My filters "pane:

1. A checkbox to wholly disable/enable "My filters". This is equivalent
   to the checkbox for "My filters" in "Filter lists" pane.

2. A checkbox to enable/disable the trustworthiness of the content
   of "My filters". Default to untrusted.

Since toggling these checkboxes requires reloading all filter lists,
their new state must be committed through the "Apply changes" button.

Additionally: a "book" icon has been added to the top-right of the
dashboard, which is a link to the wiki according to whichever pane is
currently active.
2024-03-11 11:39:31 -04:00
Raymond Hill 640eaf89d0
Import translation work from https://crowdin.com/project/ublock 2024-03-11 08:38:57 -04:00
Raymond Hill d5c359d411
Import translation work from https://crowdin.com/project/ublock 2024-03-07 13:09:24 -05:00
Raymond Hill 4f6fa840c3
Use `100svh` everywhere `100vh` is used
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3058
2024-03-06 08:45:49 -05:00
Raymond Hill 63acdcbdeb
Assume UTF-8 when no encoding can be looked up.
This will make HTML filtering and `replace=` filter option less
likely to be bypassed by uBO, as the body response filterer
previously required an encoding to be expressly declared before
acting on the response body.

UTF-8 usage is currently reported as ~98.2%:
https://w3techs.com/technologies/history_overview/character_encoding
2024-03-05 11:11:42 -05:00
Raymond Hill f18d62ee4c
Import translation work from https://crowdin.com/project/ublock 2024-03-05 08:11:39 -05:00
Raymond Hill 04fead8d8a
Group lists with unknown group to special section
Related issue:
https://old.reddit.com/r/uBlockOrigin/comments/1b6tad0
2024-03-05 08:02:55 -05:00
Raymond Hill 24d94e559d
Fix issue with "My filters" pane on mobile
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3058
2024-03-05 08:00:42 -05:00
Raymond Hill 395fa7197b
Reduce TTL of serializer workers 2024-03-05 07:27:02 -05:00
Raymond Hill 238724eed1
Fix looking-up unexisting sections in "Filter lists" pane
Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/1b6tad0/i_updated_to_the_new_dev_build_1561b10_and_now/
2024-03-04 23:57:47 -05:00
Raymond Hill 3682eed638
Use "small viewport" for max height of dashboard
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3058
2024-03-04 21:52:34 -05:00
Raymond Hill c7a9bcb7b2
Import translation work from https://crowdin.com/project/ublock 2024-03-04 11:38:55 -05:00
Raymond Hill 0a72745f9c
Import translation work from https://crowdin.com/project/ublock 2024-03-03 20:28:07 -05:00
Raymond Hill a557f62112
Support aborting "Pick" mode in element picker
This allows a user to go back to the previous selection after
entering interactive "Pick" mode.
2024-03-03 20:08:15 -05:00
Raymond Hill 0f4e50db07
Remove sections with no lists in "Filter lists" pane
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3154#issuecomment-1975413427
2024-03-03 20:05:45 -05:00
Raymond Hill 393fb91325
Import translation work from https://crowdin.com/project/ublock 2024-03-03 15:32:37 -05:00
Raymond Hill 8781ffe82a
Minor CSS fine-tuning 2024-03-03 15:31:41 -05:00
Raymond Hill 21a76e32a1
Add "Social widgets", "Cookie notices" sections in "Filter lists" pane
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3154
2024-03-03 15:29:38 -05:00
Raymond Hill aac88ac766
Import translation work from https://crowdin.com/project/ublock 2024-03-03 14:30:30 -05:00
Raymond Hill 270040d466
Fix disabled state of new benchmark buttons 2024-03-03 13:46:29 -05:00
Raymond Hill 43e0e15125
More fine-tuning of element picker visual/behavior
- Group "Pick" and "Preview"
- Set minimal button width
- Auto-minimize when picking instead of fully hiding the dialog:
  this allows to quit while in picking mode
2024-03-03 10:08:56 -05:00
Raymond Hill 7f68c62f23
Remove obsolete built-in trusted directives
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3101#issuecomment-1974922229
2024-03-02 18:02:43 -05:00
Raymond Hill 6266c4718d
Move "Quit" button to top bar in element picker
Additionally:

- Removed auto fade out of dialog when mouse does not hover the
  dialog.
- Added a minimize/maximize button in top bar

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/55
2024-03-02 16:45:03 -05:00
Raymond Hill a0a6ae0d0c
Rename module-scoped classes for better distinction in profiling data 2024-03-02 09:41:12 -05:00
Raymond Hill 7ab7104a54
Clicking again currently inspected row will close the dialog 2024-03-02 09:37:15 -05:00
Raymond Hill 252656968e
Benchmark buttons must be disabled by default 2024-03-02 08:58:49 -05:00
Raymond Hill 7a768e7b1a
No longer disable generic cosmetic filters by default on mobile
As discussed with filter list maintainers.
2024-03-02 08:52:42 -05:00
Raymond Hill 96704f2fda
Make asset updater compatible with non-persistent background page
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2969

Additionally, modified default timing values for asset updater and
selfie creation.
2024-03-01 19:52:55 -05:00
Raymond Hill 80b66c849a
Add more benchmark tools to devtool page 2024-03-01 17:26:21 -05:00
Raymond Hill 9215fefab4
Remove Kurdish as target language
No translation work has ever be done to it.
2024-03-01 16:26:14 -05:00
Raymond Hill 953c978d59
Move dragbar to the top of element picker dialog
Also fine-tuning CSS for small screen displays.

Related feedback:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/871
2024-03-01 11:56:22 -05:00
Raymond Hill e02ea69c86
Add advanced setting `requestStatsDisabled`
To disable collating global blocked/allowed counts.

Boolean, default to `false`.

Setting to `true` will prevent uBO from loading/saving global
blocked/allowed counts, and in such case the "Blocked since
install" count instead reflects the count since uBO launched.

Setting back to `false` will cause the counts to resume from
last time they were saved.

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3100
2024-02-29 19:53:06 -05:00
Raymond Hill 801d6500b0
Fix idbStorage.keys()
Related commit:
https://github.com/gorhill/uBlock/commit/d4efaf020b
2024-02-29 13:28:04 -05:00
Raymond Hill 059e4e5e28
Imrpove saving request stats for non-persistent background page
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2969

Related previous commit:
https://github.com/gorhill/uBlock/commit/5a338b7210

The save-to-storage period is back to being around ~4 minutes, but
now browser.storage.session API is used to keep track of request
stats should the extension be suspended before the period elapse.
2024-02-29 11:43:51 -05:00
Raymond Hill 09bba3199e
Import translation work from https://crowdin.com/project/ublock 2024-02-29 09:48:01 -05:00
Raymond Hill d7154de9e9
Minor renaming of variables 2024-02-29 09:18:07 -05:00
Raymond Hill ba95d2bc49
Minor code review of last commit
Related commit:
https://github.com/gorhill/uBlock/commit/2b16a10b82
2024-02-29 08:37:44 -05:00
Raymond Hill 2b16a10b82
First lookup matching stock lists when importing URLs
Related discussion:
https://github.com/MasterKia/PersianBlocker/discussions/224
2024-02-29 07:51:08 -05:00
Raymond Hill b0067b79d5
Reset filter lists in worker when creating filters via "Block element"
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/968
2024-02-28 18:53:27 -05:00
Raymond Hill d4efaf020b
Make indexedDB to default fast cache by default
Turns out it's currently the fastest among the three currently
implemented (Cache, browser.storage.session, indexedDB). Possibly
because indexedDB can natively persist structure-cloneable data,
something uBO can now benefit with the work on abstracting away
the limitations of various storages being limited to persist only
text or JSON data.

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2969
2024-02-28 17:31:29 -05:00
Raymond Hill 9862446b10
Various fine tuning code of recent commits 2024-02-28 13:32:24 -05:00
Raymond Hill 3c299b8632
Remove trusted-source requireement when using `badfilter`
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3136
2024-02-28 12:14:59 -05:00
Raymond Hill 79ea85dbc4
More fine tuning of cache storage-related code 2024-02-27 21:47:06 -05:00
Raymond Hill b0fc5d3d21
Fix race condition when saving cache registry
Related to new cache storage code.
2024-02-27 18:41:10 -05:00
Raymond Hill 7590c0711d
Fine-tune cache storage related-code
Related discussion:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/876

Related commit:
086766a924
2024-02-27 15:04:05 -05:00
Raymond Hill 086766a924
Redesign cache storage
In uBO, the "cache storage" is used to save resources which can
be safely discarded, though at the cost of having to fetch or
recompute them again.

Extension storage (browser.storage.local) is now always used as
cache storage backend. This has always been the default for
Chromium-based browsers.

For Firefox-based browsers, IndexedDB was used as backend for
cache storage, with fallback to extension storage when using
Firefox in private mode by default.

Extension storage is reliable since it works in all contexts,
though it may not be the most performant one.

To speed-up loading of resources from extension storage, uBO will
now make use of Cache API storage, which will mirror content of
key assets saved to extension storage. Typically loading resources
from Cache API is faster than loading the same resources from
the extension storage.

Only resources which must be loaded in memory as fast as possible
will make use of the Cache API storage layered on top of the
extension storage.

Compiled filter lists and memory snapshot of filtering engines
(aka "selfies") will be mirrored to the Cache API storage, since
these must be loaded into memory as fast as possible, and reloading
filter lists from their compiled counterpart is a common
operation.

This new design makes it now seamless to work in permanent private
mode for Firefox-based browsers, since extension storage now
always contains cache-related assets.

Support for IndexedDB is removed for the time being, except to
support migration of cached assets the first time uBO runs with
the new cache storage design.

In order to easily support all choices of storage, a new serializer
has been introduced, which is capable of serializing/deserializing
structure-cloneable data to/from a JS string.

Because of this new serializer, JS data structures can be stored
directly from their native representation, and deserialized
directly to their native representation from uBO's point of view,
since the serialization occurs (if needed) only at the storage
interface level.

This new serializer simplifies many code paths where data
structures such as Set, Map, TypedArray, RegExp, etc. had to be
converted in a disparate manner to be able to persist them to
extension storage.

The new serializer supports workers and LZ4 compression. These
can be configured through advanced settings.

With this new layered design, it's possible to introduce more
storage layers if measured as beneficial (i.e. maybe
browser.storage.session)

References:
- https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/local
- https://developer.mozilla.org/en-US/docs/Web/API/Cache
- https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
2024-02-26 16:50:11 -05:00
Raymond Hill 2262a129ec
Don't match network filter-derived regexes against non-network URIs
Context: element picker

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3142
2024-02-26 16:08:12 -05:00
Raymond Hill 439a059cca
Remove obsolete trusted directives
All supported browsers now have the concept of priviledged
pages, there is no need for these extra trusted-site directives.

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3101
2024-02-19 11:06:39 -05:00
Raymond Hill fef26e234d
Make the "untrusted sources" warning always visible
It won't disappear when vertical space is restricted.
2024-02-18 08:00:34 -05:00
Raymond Hill 9666eeb9cf
Do not treat selectors as "common" when char 0x09-0x0D are in attr value 2024-02-17 20:25:41 -05:00
Raymond Hill be3e366019
Escape special whitespace characters in attribute values
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3127

Reference:
https://mathiasbynens.be/notes/css-escapes
2024-02-17 19:57:44 -05:00
Raymond Hill 2a5a444482
Mind that multiple `uritransform` may apply to a single request
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3125
2024-02-15 14:34:50 -05:00
Raymond Hill 9bff0c2f94
Fix incorrect built-in filtering expression in logger
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3126
2024-02-15 14:03:15 -05:00
Raymond Hill 41511726dc
Further improve detection of forbidden `report-xxx` usage in filters
As per feedback from https://github.com/distinctmondaylila

Related commit:
https://github.com/gorhill/uBlock/commit/db5656f607
2024-02-14 14:48:31 -05:00
Raymond Hill 21ec5a277c
Fix improper invalidation of valid `uritransform` exception filters
Related feedback:
https://github.com/uBlockOrigin/uBlock-discussions/discussions/831#discussioncomment-8461847
2024-02-14 14:30:05 -05:00
Raymond Hill 68186a9242
Minor code review 2024-02-13 17:52:05 -05:00
Raymond Hill d80a3e30f8
Minor code review 2024-02-13 16:41:45 -05:00
Fanboynz 397d6d47b9
Fix Chartbeat flicker control div's (#3913) 2024-02-13 16:35:20 -05:00
Raymond Hill a7786a0a32
Import translation work from https://crowdin.com/project/ublock 2024-02-13 15:36:10 -05:00
Raymond Hill 7b138b58c6
Fix potential exfiltration of browsing history by a rogue list author through permissions=
As with `csp=` option, reporting capabilities need to be taken
into account with `permissions=` option.

Reference:
https://github.com/w3c/webappsec-permissions-policy/blob/main/reporting.md

This commit ensures that `permissions=` option using `report-to` are
marked as invalid.
2024-02-13 15:09:38 -05:00
Raymond Hill db5656f607
Fix potential exfiltration of browsing history by a rogue list author through `csp=`
As reported internally to ubo-security by https://github.com/distinctmondaylila

One issue is a regression from the rewriting of the static filtering
parser in version 1.47.0, specifically the following commit:
https://github.com/gorhill/uBlock/commit/8ea3b0f64c
The existing regex was no longer suitable to properly detect
some usage of `report-xxx` in the rwritten parser.

Another issue which predates 1.47.0 is that the regex used for
validation was case-sensititive, while the `report-uri` directive
can be written using uppercase letters, i.e. `Report-uri`.
2024-02-13 14:35:08 -05:00
Raymond Hill 28e1424058
Fall back to console if log info can't be relayed to logger 2024-02-02 09:24:24 -05:00
Raymond Hill b0122bb9fc
Do not rely on `vAPI` presence in logger broadcast code
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3096#discussioncomment-8339494
2024-02-02 09:15:09 -05:00
Raymond Hill 59d46ecd78
Postprocess selections only from from logger entries
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3097
2024-01-28 11:17:36 -05:00
Raymond Hill 030072c324
Output more information to dev console when loading filter lists
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/discussions/2993#discussioncomment-8265914
2024-01-27 18:23:04 -05:00
Raymond Hill fa162e2a31
Fix type
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3096#discussioncomment-8265304
2024-01-27 08:56:00 -05:00
Raymond Hill cd736b515c
Fix bad CSS style 2024-01-27 07:54:37 -05:00
Raymond Hill 7fee16a4bd
Minor CSS changes in logger's 'Export' tool 2024-01-27 07:51:05 -05:00
Raymond Hill 9d1d5f9839
Support 'week' unit in `! Expires: ` directive 2024-01-27 07:36:58 -05:00
Raymond Hill f200bbf5d5
Add trace information to console 2024-01-27 07:22:32 -05:00
Raymond Hill cb6ff38f86
Fix error when site has only exception scriptlet filters
Cause by recent refactoring of scriptlet-related code.
2024-01-26 20:57:26 -05:00
Raymond Hill 94ec65b7db
Fix regression in response body filtering 2024-01-26 13:52:17 -05:00
Raymond Hill 34da372d7a
Ensure scriptlet logging information make it to destination
Avoid race conditions between isolated world-side broadcast channel
and main-side broadcast channel, so as to not lose logging
information if the isolated world-side is not yet ready to
receive through its broadcast channel.

Additionally, added new scriptlet: `trusted-replace-argument`.

[...]##+js(trusted-replace-argument, fn, argpos, argval [,condition, pattern])

Where:

- `fn` is the function we want to proxy through an `apply` handler.
  This can also be a class, in which case the scriptlet will proxy
  through `construct` handler. At the moment, `fn` must exist at the
  time the scriptlet executes.

- `argpos` is the 0-based position of the argument we want to change

- `argval` is the value we want to have for the argument -- the value
  is interpreted the same way the value for `set-constant` is
  interpreted.

- `condition, pattern` is a vararg which tells the scriptlet to act
  only if `pattern` is found in the argument to overwrite.

Example of usage:

    alliptvlinks.com##+js(trusted-replace-argument, MutationObserver, 0, noopFunc)
2024-01-26 12:18:30 -05:00
Raymond Hill 55e4cee6e8
Discard repeating adjacent entries in the logger 2024-01-26 09:24:10 -05:00
Raymond Hill 567508f619
Fix regression in looking up scriptlets for entity
Related feedback:
https://www.reddit.com/r/uBlockOrigin/comments/19fihsu/
2024-01-26 06:46:21 -05:00
Raymond Hill 49a6dc868f
Fix verbose mode not applying to newly injected scriptlets
Related commit:
869a653fdf
2024-01-25 13:30:41 -05:00
Raymond Hill c11db790ff
Import translation work from https://crowdin.com/project/ublock 2024-01-25 12:49:32 -05:00
Raymond Hill feb05f7e83
Add default tooltip until i18n-ed 2024-01-25 12:43:31 -05:00
Raymond Hill 869a653fdf
Output scriptlet logging information to the logger
This commit brings the following changes to the logger:

All logging output generated by injected scriptlets are now sent to
the logger, the developer console will no longer be used to log
scriptlet logging information.

When the logger is not opened, the scriplets will not output any
logging information.

The goal with this new approach is to allow filter authors to
more easily assess the working of scriptlets without having to
go through scriptlet parameters to enable logging.

Consequently all the previous ways to tell scriptlets to log
information are now obsolete: if the logger is opened, the
scriptlets will log information to the logger.

Another benefit of this approach is that the dev tools do not
need to be open to obtain scriptlets logging information.

Accordingly, new filter expressions have been added to the logger:
"info" and "error". Selecting the "scriptlet" expression will also
keep the logging information from scriptlets.

A new button has been added to the logger (not yet i18n-ed): a
"volume" icon, which allows to enable verbose mode. When verbose
mode is enabled, the scriptlets may choose to output more
information regarding their inner working.

The entries in the logger will automatically expand on mouse hover.
This allows to scroll through entries which text does not fit into
a single row.

Clicking anywhere on an entry in the logger will open the detailed
view when applicable.

Generic information/errors will now be rendered regardless of which
tab is currently selected in the logger (similar to how tabless
entries are already being rendered).
2024-01-25 12:20:38 -05:00
Raymond Hill f1889b02ee
[mv3] Fix conversion of `:xpath` procedural filters
Procedural filters with `:xpath` operator were silently rejected
at conversion time because the parser was failing to evaluate the
xpath expression due to the absence of a `document` object in
nodejs.

If `document` object is not present, the parser will assume the
xpath expression is valid.
2024-01-22 10:57:48 -05:00
Raymond Hill 3d576603c4
[mv3] `uritransform` cannot be converted to DNR 2024-01-21 14:32:14 -05:00
Raymond Hill 49dd68ef3d
Code review recent commit re. quoting parameters
Related commit:
fa3a290ad4
2024-01-21 09:26:17 -05:00
Raymond Hill fa3a290ad4
Fix decompiling of scriptlet parameters
Scriptlets parameters which are quoted must be re-quoted when
output to the logger to be sure they can be properly looked up
in the list, and that they can be used through copy-paste
operations.
2024-01-20 21:46:12 -05:00
Raymond Hill f624c835c2
Remove minimum height constraint from "My filters" pane
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3058
2024-01-19 11:26:01 -05:00
Raymond Hill 13dcd844a7
Unregister all scriptlets when disabling uBO on a specific site
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3083

This will not completely eliminate the issue but it should
lower the likelihood it will occur -- so at least uBO can
still benefit from reliable scriptlet execution in Firefox.
2024-01-19 11:00:07 -05:00
Raymond Hill b19094339f
Allow `uritransform` to process the hash part of a URL
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3084
2024-01-18 11:36:40 -05:00
Raymond Hill f4f6b5d864
Import translation work from https://crowdin.com/project/ublock 2024-01-17 10:44:41 -05:00
Raymond Hill 3d1b100646
Remember presentation state of "My rules" pane
Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/198ohgi/
2024-01-17 10:36:23 -05:00
Raymond Hill 0e00010b91
Fix improperly assembled `!#include` sublists
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3077
2024-01-16 10:04:21 -05:00
Raymond Hill 757b8be9cd
Mark procedural filters with pseudo-elements selector as invalid
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2786
2024-01-16 09:25:22 -05:00
Raymond Hill 101cef44d2
Import translation work from https://crowdin.com/project/ublock 2024-01-16 08:49:52 -05:00
Raymond Hill bc641fc024
Prevent access to picker when "My filters" is not enabled
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3076
2024-01-16 08:31:46 -05:00
Raymond Hill 3e6333d02b
Further fine tune visual as per feedback
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3066#issuecomment-1891023881
2024-01-14 13:29:58 -05:00
Raymond Hill c4bb8a0f64
Provide visual feedback when applying changes in "Filter lists" pane
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3066#event-11479409505
2024-01-14 11:25:41 -05:00
Raymond Hill a605f13e63
Import translation work from https://crowdin.com/project/ublock 2024-01-14 09:58:34 -05:00
Raymond Hill 1cac61a9a4
Empty query parameters must still use `=`
Related issue:
https://github.com/uBlockOrigin/uAssets/commit/453b544f31
2024-01-14 08:03:03 -05:00
Raymond Hill e15cb4e8d3
Import translation work from https://crowdin.com/project/ublock 2024-01-12 17:50:08 -05:00
Raymond Hill 1c1091b83f
import translation work from https://crowdin.com/project/ublock 2024-01-12 12:05:03 -05:00
Raymond Hill 936444883f
Add support to toggle no-scripting switch with keyboard shortcut
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/692
2024-01-12 12:01:23 -05:00
Raymond Hill c03c23d962
Import translation work from https://crowdin.com/project/ublock 2024-01-12 12:00:55 -05:00
Raymond Hill 63fe18a761
Do not exceed rate-limited calls to handlerBehaviorChanged()
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3063

To prevent spurious performance warnings by chromium-based browsers.
2024-01-11 13:25:19 -05:00
Raymond Hill f6b726136c
Do not prevent applying changes when lists are updating
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3066
2024-01-11 10:50:18 -05:00
Raymond Hill 010cd3f9e0
Import translation work from https://crowdin.com/project/ublock 2024-01-10 12:59:09 -05:00
Raymond Hill a9eb9630cf
Do not use tab character as field separator
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2730#issuecomment-1881821674

Character `\x1F` is now used instead.
2024-01-09 14:31:00 -05:00
Raymond Hill 4234faafc4
Use arrow function 2024-01-04 11:01:51 -05:00
Raymond Hill 9a104bcbd2
Prevent `:others()` from hiding `html` tag
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3060
2024-01-04 10:57:27 -05:00
Raymond Hill 1ea1ff7f4f
Import translation work from https://crowdin.com/project/ublock 2024-01-01 10:30:57 -05:00
Raymond Hill 00fb5f18b2
Add to error message 2023-12-26 11:32:08 -05:00
Raymond Hill 26f45e1fdf
Import translation work from https://crowdin.com/project/ublock 2023-12-23 17:45:36 -05:00
Raymond Hill ec8292ef92
Fix bad text colors in logger for dark theme
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/discussions/1963#discussioncomment-7921578
2023-12-22 19:49:36 -05:00
Raymond Hill f81d71c6e8
Mind type of drop event items
Related feedback:
https://github.com/gorhill/uBlock/commit/c8b7d1a526#commitcomment-135590810
2023-12-22 11:45:35 -05:00
Raymond Hill c8b7d1a526
Mind drop events in filter expression field of logger
Related discussion:
https://github.com/uBlockOrigin/uBlock-issues/issues/3036#issuecomment-1867497436
2023-12-22 10:45:43 -05:00