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

2831 Commits

Author SHA1 Message Date
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
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
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
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
885b3ea6c0
Fix spurious update cycle attempts
Caused by the fact that external filter lists do not have an
`off` property even when they are not enabled.

Additionally, set the default update cycle check period to 2hr.
2023-03-27 15:04:44 -04:00
Raymond Hill
75abf77e62
Fix patching {{args}} when instances of $ are present
Related feedback:
- https://github.com/uBlockOrigin/uAssets/issues/16715#issuecomment-1484232457
2023-03-27 09:04:35 -04:00
Raymond Hill
f7f776fb8a
Aggressively update assets when at least one is very obsolete
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1165
2023-03-26 20:32:51 -04:00
Raymond Hill
a8a46c4593
Normalize non-ASCII characters in :matches-path() argument
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2369
2023-03-26 15:37:15 -04:00
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
236fb3ad59
Add scriptlet dependencies to reduce code duplication 2023-03-26 09:13:17 -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
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
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
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
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
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
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
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
Raymond Hill
464b54bbc6
Add ext_devbuild as preparser directive
In order to be able to create filters which only work with the
dev build of uBO.
2023-03-14 19:11:29 -04:00
Raymond Hill
c0529307fa
Properly handle failed fetches in code viewer 2023-03-14 08:58:52 -04:00
Raymond Hill
6ba758d007
Add button to code viewer to reload code from server 2023-03-14 08:43:23 -04:00
Raymond Hill
6220c4d9d5
Improve code viewer convenience
- Retain cursor position, selection, undo history, etc. when swapping
  documents.
- Add ability to remove a document from dropdown list
2023-03-13 10:51:55 -04:00
Raymond Hill
4bf3fe7b5b
Fix minor details in new code viewer
- Automatically remove quotes around URLs pasted in input field
- Fix editor not getting the focus after interacting with input
  field
2023-03-12 17:47:21 -04:00
Raymond Hill
caeb848c56
Fix race condition when looking up current auto/light/dark theme
Related feedback:
- e2dd008388 (commitcomment-104105757)
2023-03-12 11:20:54 -04:00
Raymond Hill
7b632b32a8
Fix "View source..." context menu entry in Firefox 2023-03-12 10:21:30 -04:00
Raymond Hill
4b6ce5e402
Cleanup unused code
Related discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1529
- https://github.com/uBlockOrigin/uBlock-issues/discussions/1958#discussioncomment-5257148
2023-03-12 10:08:20 -04:00
Raymond Hill
b63ced24d4
Fix broken filter parsing when prepended with spaces
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2540
2023-03-12 09:45:33 -04:00
Raymond Hill
e2dd008388
Add 'View source...' entry in context menu
This new context menu entry will be available only when the
advanced setting `filterAuthorMode` is set to `true`. See:

https://github.com/gorhill/uBlock/wiki/Advanced-settings#filterauthormode

The purpose is for filter list maintainers to easily access
the source code of web pages when investigating filter issues,
without having to necessarily go through the logger.

Additionally an input field to enter URL directly has been
added to the code viewer for convenience.
2023-03-11 15:55:51 -05:00
Raymond Hill
7bfa8f260b
Just select already existing tab when opening link from logger 2023-03-11 09:40:34 -05:00
Raymond Hill
574f30ed43
Context of about:blank is that of parent frame (popup option)
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2534#discussioncomment-5264792
2023-03-10 08:48:48 -05:00
Raymond Hill
3c4c3767a2
Report filter list of invalid filter in logger
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/discussions/2534
2023-03-10 06:48:57 -05:00
Raymond Hill
890aabaae9
Make parser take into account filterOnHeaders setting
Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1134#issuecomment-1460638431
2023-03-08 13:49:21 -05:00