1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-04 01:59:38 +02:00
Commit Graph

4564 Commits

Author SHA1 Message Date
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
Raymond Hill
49c8310e22
Fix message entry overflowing in logger
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3021
2023-12-21 12:02:57 -05:00
Raymond Hill
826bc7d457
It's ok for toLogger() to be in derived class
Related commit:
aa7f77aaad
2023-12-21 11:14:33 -05:00
Raymond Hill
aa7f77aaad
Split scriptlet filtering engine into lo- and hi-level classes
The idea is to remove as many dependencies as possible for
low-level ScriptletFilteringEngine in order to make it easier
to reuse the module outside uBO itself.

The high-level derived class takes care of caching and
injection of scriptlets into documents, which requires
more knowledge about the environment in which scriptlets
are to be used.

Also improve scriptlet cache usage to minimize overhead of
retrieving scriptlets.
2023-12-21 10:48:01 -05:00
Raymond Hill
abeadf18eb
Add support for application/x-javascript in replace= option
Related issue:
https://github.com/uBlockOrigin/uAssets/issues/5090
2023-12-21 10:43:14 -05:00
Raymond Hill
9a8dd66517
Fix having picker & inspector active at the same time
Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3004#issuecomment-1863610146
2023-12-20 11:23:25 -05:00
Raymond Hill
462e8fe917
Import translation work from https://crowdin.com/project/ublock 2023-12-19 12:04:22 -05:00
Raymond Hill
7f2703acd6
Only filter lists are diff-updatable 2023-12-19 11:51:20 -05:00
Raymond Hill
443c1f81e1
Extend support for differential updates to imported lists
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3028
2023-12-19 11:01:40 -05:00
Raymond Hill
24ab492b77
Fix overlooking whether auto-update is disabled
Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/18ktpd5/
2023-12-18 10:41:48 -05:00
Raymond Hill
ebd9d93666
Prevent element picker from throwing when targeting html/body
Occurred when element picker was launched from context menu
as a result of clicking on `html` or `body` elements.
2023-12-16 11:23:58 -05:00