1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-02 00:42:45 +01:00
Commit Graph

10590 Commits

Author SHA1 Message Date
Raymond Hill
da672d4dbf
Add extra check to detect function declaration in scriptlets
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/122pqyg/
2023-03-26 13:14:00 -04:00
Raymond Hill
5c9c87e485
Add ability for scriptlets to share local data
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1741

As a result of the new capability, usage of RegExp API in `aost`
scriptlet has been shielded from the webpage tampering with the
API.
2023-03-26 12:31:36 -04:00
Raymond Hill
c7c748862e
Make Firefox dev build auto-update 2023-03-26 09:20:42 -04:00
Raymond Hill
8735631f6c
New revision for dev build 2023-03-26 09:14:49 -04:00
Raymond Hill
236fb3ad59
Add scriptlet dependencies to reduce code duplication 2023-03-26 09:13:17 -04:00
Raymond Hill
439951824a
Remove addEventListenerLogger, expand addEventListenerDefuser
The scriptlet addEventListenerLogger has been removed.

The logging of addEventListener() calls can now be done with the
addEventListenerDefuser scriptlet, which now supports the
following named arguments:

"type": the event type to match. Default to '', i.e. match-all.

"pattern": the pattern to match against the handler argument
Default to '', i.e. match-all.

"log": an integer value telling when to log:

- 1: log only when both type and pattern matches, i.e. when a
     call to addEventListener() is defused
- 2: log when either the type or pattern matches
- 3: log all calls to addEventListener()

"debug": an integer value telling when to break into the
 debugger, useful to inspect the debugger's call stack.

- 1: break into the debugger when both type and pattern match,
     so effectively when defusing is taking place.
- 2: break into the debugger when either type or pattern matches.

The usage of named arguments is optional, positional arguments
are still supported as documented. Named arguments is required
to use "log" and/or "debug" arguments.

Obviously, do not use "log" or "debug" in any filter list, these
are investigative tools for filter list authors.

Examples of usage using named arguments:

  wikipedia.org##+js(aeld, { "type": "/mouse/", "pattern": "/.^/", "log": 2 })

Above filter will log calls to addEventListener() which have the
pattern "mouse" in the event type (so "mouseover", "mouseout",
etc.) without defusing any of them (because pattern can't match
anything).

  wikipedia.org##+js(aeld, { "type": "/.^/", "log": 2 })

Above filter will log all calls without defusing any of them
(because type can't match anything)

  wikipedia.org##+js(aeld, { "log": 1 })

Above filter will log and defuse all calls to addEventListener().
2023-03-25 12:35:56 -04:00
Raymond Hill
a51130baed
Remove unused scriptlets 2023-03-24 18:46:39 -04:00
Raymond Hill
a355a73aa2
Make Firefox dev build auto-update 2023-03-24 16:10:33 -04:00
Raymond Hill
c1045ad20b
New revision for dev build 2023-03-24 15:58:59 -04:00
Raymond Hill
a42374199e
Fix regression in parsing scriptlet arguments
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2557
2023-03-24 15:57:48 -04:00
Raymond Hill
21ccaaf804
Make Firefox dev build auto-update 2023-03-24 14:45:57 -04:00
Raymond Hill
1b45918119
New revision for dev build 2023-03-24 14:30:23 -04:00
Raymond Hill
18a84d2819
Refactor scriptlets injection code
Builtin scriptlets are no longer parsed as text-based resources,
they are imported as JS functions, and `toString()` is used to
obtain text-based representation of a scriptlet.

Scriptlet parameters are now passed as function call arguments
rather than by replacing text-based occurrences of `{{i}}`. The
arguments are always string values (see below for exception).

Support for argument as Object has been added. This opens the
door to have scriptlets using named arguments rather than
positional arguments, and hence easier to extend functionality
of existing scriptlets. Example:

    example.com##+js(scriplet, { "prop": "adblock", "value": false, "log": true })

Compatibility with user-provided scriptlets has been preserved.

User-provided scriptlets can benefit some of the changes:

Use the form `function(..){..}` instead of `(function(..){..})();`
in order to received scriptlet arguments as part of function call
-- instead of using `{{i}}`.

If using the form `function(..){..}`, you can choose to receive
an Object as argument -- just be sure that your scriptlet's
parameter is valid JSON notation.
2023-03-24 14:05:18 -04:00
Raymond Hill
56b8201196
Ensure astSelectorsFromSelectorList receive expected arguments
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2554
2023-03-23 14:57:31 -04:00
Raymond Hill
6f0ab28258
Make Firefox dev build auto-update 2023-03-23 13:56:22 -04:00
Raymond Hill
c9cb05197d
New revision for dev build 2023-03-23 13:41:28 -04:00
Raymond Hill
2cd062898c
Properly handle default list status changes in assets.json
This commit fix properly handling toggling off the default
status of a list such that the list will be automatically
turned off when its status change from default to non-default.

Additionally, imported lists which become stock lists will
be properly migrated from imported lists section.
2023-03-23 13:40:51 -04:00
Raymond Hill
6d989744bb
Import translation work from https://crowdin.com/project/ublock 2023-03-21 12:12:17 -04:00
Raymond Hill
0a4ac76171
New revision for stable release 2023-03-21 12:10:09 -04:00
Raymond Hill
eebd472846
Make Firefox dev build auto-update 2023-03-21 10:31:34 -04:00
Raymond Hill
7224da7099
Ne wrevision for release candidate 2023-03-21 10:23:53 -04:00
Raymond Hill
72cc9a8fe8
Fix broken http header filtering
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2552
2023-03-21 10:22:32 -04:00
Raymond Hill
285ce54d9c
Add regional filter list for Croatia/Serbia
Related discussion:
- https://github.com/uBlockOrigin/uAssets/issues/17088#issuecomment-1460942565
2023-03-21 09:56:43 -04:00
Raymond Hill
126772459a
Make Firefox dev build auto-update 2023-03-19 07:31:07 -04:00
Raymond Hill
1cdbf2d06d
New revision for release candidate 2023-03-19 07:26:48 -04:00
Raymond Hill
2f42cf61ab
Properly handle potential exception from webext API
Related feedback:
- https://github.com/uBlockOrigin/uAssets/discussions/16939#discussioncomment-5356808
2023-03-19 07:25:06 -04:00
Raymond Hill
6e87026d40
Make Firefox dev build auto-update 2023-03-18 17:36:22 -04:00
Raymond Hill
3abbf0def5
New revision for release candidate 2023-03-18 17:25:09 -04:00
Raymond Hill
60827c603d
Cached managed storage content for faster readiness
Related issue:
- https://github.com/uBlockOrigin/uAssets/discussions/16939
2023-03-18 17:23:13 -04:00
Raymond Hill
e8abd5dfbe
Fix report of unprocessed requests in Support pane 2023-03-18 16:20:40 -04:00
Raymond Hill
d42e9ae2a8
Add dev console boot sequence info 2023-03-18 14:37:49 -04:00
Raymond Hill
8c5fd9f53c
Make Firefox dev build auto-update 2023-03-18 12:36:37 -04:00
Raymond Hill
bb462e6e5d
Actual icon color is #FFCC00, not #FC0 2023-03-18 12:27:40 -04:00
Raymond Hill
8bef11a871
New revision for release candidate 2023-03-18 12:17:49 -04:00
Raymond Hill
a72c068bcc
Make badge color consistent with filtering status
Related commit:
- 32508620a2
2023-03-18 12:16:20 -04:00
Raymond Hill
820d988fa9
Make Firefox dev build auto-update 2023-03-18 11:51:00 -04:00
Raymond Hill
bf621680fe
New revision for release candidate 2023-03-18 11:43:57 -04:00
Raymond Hill
32508620a2
Emphasize broken filtering at launch on toolbar icon badge
Related feedback:
- 769b8da664 (commitcomment-104695781)

The incomplete filtering status of a given tab at browser launch
will be carried over visually as a yellowish `!` badge until the
web page in the tab is force reloaded, navigated away, or closed.

The purpose is to make it obvious to end users that a web page
has not been filtered properly and to avoid issue reports
related to this.

It is expected that Firefox should never be affected by cases of
yellowish badge -- that is unless the setting "Suspend network
activity [...]" has been disabled, in which case the new behavior
will also be useful to those who disabled the setting.
2023-03-18 11:35:06 -04:00
Raymond Hill
4d81e5a8d4
Make Firefox dev build auto-update 2023-03-16 15:06:18 -04:00
Raymond Hill
c19cbaa84b
New revision for release candidate 2023-03-16 14:55:11 -04:00
Raymond Hill
a9c7369340
Minor fine tuning 2023-03-16 14:54:45 -04:00
Raymond Hill
fd9bb02aab
Fix search widget when swapping document in new code viewer 2023-03-16 12:36:02 -04:00
Raymond Hill
aa21952379
Make Firefox dev build auto-update 2023-03-16 09:26:31 -04:00
Raymond Hill
5c92d95143
Prevent dashboard from loading at browser launch until ready
Related discussion:
- https://github.com/uBlockOrigin/uAssets/discussions/16939

Various feedback of people trying to interact with uBO's dashboard
at browser launch, before uBO's main process is fully initialized,
causing confusion, and potential loss of data.
2023-03-16 09:17:36 -04:00
Raymond Hill
0cfc4ee396
New revision for dev build 2023-03-16 07:57:16 -04:00
Raymond Hill
769b8da664
Finalize "unreadiness" toolbar icon
- Yellow uBO toolbar icon: uBO not ready

- Yellow uBO toolbar icon + `!` badge: network requests went
  through while uBO is not ready
2023-03-16 07:13:27 -04:00
Raymond Hill
86753c5e69
Make Firefox dev build auto-update 2023-03-15 21:26:26 -04:00
Raymond Hill
6afc26c46b
New revision for release candidate 2023-03-15 21:16:12 -04:00
Raymond Hill
39cac612c2
Use the warning toolbar icon only if unprocessed requests
Related discussion:
- https://github.com/uBlockOrigin/uAssets/discussions/16939

Related commit:
- 0c9576d3e6
2023-03-15 21:13:28 -04:00
Raymond Hill
8e35aa74f0
Report only launch-time value of maxAssetCacheWait 2023-03-15 08:32:56 -04:00