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

12625 Commits

Author SHA1 Message Date
Raymond Hill
86aeae75df
Further fix npm documentation, minor code review 2024-10-06 17:03:18 -04:00
Raymond Hill
9233e6b7c6
Fix npm documentation
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3402
2024-10-06 16:29:42 -04:00
Raymond Hill
ccbf957f55
Make Firefox dev build auto-update 2024-10-06 15:06:21 -04:00
Raymond Hill
1f32bbc322
New revision for dev build 2024-10-06 14:57:07 -04:00
Raymond Hill
cc60dfa4c5
Update changelog 2024-10-06 14:56:47 -04:00
Raymond Hill
c746633693
Validate result type of XPath expressions
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3403

To ensure XPath expressions not meant to return a nodeset are
discarded at compile time.
2024-10-06 14:27:55 -04:00
Raymond Hill
447476ab9b
New npm package version 2024-10-06 14:27:46 -04:00
Raymond Hill
a12bf9405e
Make Firefox dev build auto-update 2024-10-06 12:40:51 -04:00
Raymond Hill
e0eb59c5d4
New revision for dev build 2024-10-06 12:34:58 -04:00
Raymond Hill
5700424716
Update changelog 2024-10-06 12:34:26 -04:00
Raymond Hill
818cb2d801
Fix npm test suite
Related commits:
- https://github.com/gorhill/uBlock/commit/02cba63331
- https://github.com/gorhill/uBlock/commit/41693407b2
2024-10-06 11:15:08 -04:00
Raymond Hill
160d7f3c33
Improve trusted-override-element-method scriptlet
Support `debug` as valid `disposition` value: to trigger a `debugger`
statement, but only if uBO's logger is opened.

Related feedback:
https://github.com/uBlockOrigin/uAssets/issues/25510#issuecomment-2395446342
2024-10-06 11:07:42 -04:00
Raymond Hill
1f45902a61
Make Firefox dev build auto-update 2024-10-05 16:21:29 -04:00
Raymond Hill
4775c9cb45
New revision for dev build 2024-10-05 16:10:03 -04:00
Raymond Hill
4c1b1d4cdb
Update changelog 2024-10-05 16:09:41 -04:00
Raymond Hill
64b2086ba4
Add ability to lookup parameter name in urlskip=
Relate case:
https://github.com/uBlockOrigin/uBlock-issues/issues/3206#issuecomment-2395121619

Newly supported step: `&i`, meant to lookup a parameter's name at
position `i` (1-based). The parameter name will be used as the
URL (whereas `?` is meant to lookup a parameter's value).
2024-10-05 14:59:43 -04:00
Raymond Hill
02cba63331
Partially revert 4169340 2024-10-05 14:51:38 -04:00
Raymond Hill
5f2ee6caf8
Make Firefox dev build auto-update 2024-10-05 14:00:44 -04:00
Raymond Hill
73404e5988
New revision for dev build 2024-10-05 13:30:49 -04:00
Raymond Hill
5145747ac7
Update chengelog 2024-10-05 13:30:18 -04:00
Raymond Hill
6d2b3375f8
Mind that BroadcastChannel contructor can throw in Firefox
BroadcastChannel constructor throws in Firefox when Enhanced
Tracking Protection is set to "strict".

This behavior could cause scriptlet injection to wholly break
when uBO's logger was opened, as BroadcastChannel() is used
by scriptlets to report information to the logger.

This commit ensures that exceptions from BroadcastChannel
constructor are properly handled.

The scriptlets will fall back to report at the console should
they be unable to report to the logger through BroadcastChannel.
2024-10-05 12:42:30 -04:00
Raymond Hill
41693407b2
Fix npm test suite
Ensure serialization returns copy of data rather than live
references to data. This allows to immediately deserialize() the
result of serialize().

Also, adjust code to modified behavior of filterQuery().
2024-10-05 11:32:59 -04:00
Raymond Hill
3b53d8e5b7
Update changelog 2024-10-05 08:43:14 -04:00
Raymond Hill
95b0ce5e3a
Add trusted-override-element-method scriptlet
@description
Override the behavior of a method on matching elements.

@param methodPath
The method which calls must be intercepted.

@param [selector]
A CSS selector which the target element must match. If not specified,
the override will occur for all elements.

@param [disposition]
How the override should be handled. If not specified, the overridden call
will be equivalent to an empty function. If set to `throw`, an exception
will be thrown. Any other value will be validated and returned as a
supported safe constant.

@example
..##+js(trusted-override-element-method, HTMLAnchorElement.prototype.click, a[target="_blank"][style])
2024-10-05 08:35:43 -04:00
Raymond Hill
a0a33eb9b9
Code review for new trusted-prevent-dom-bypass scriptlet
Related commit:
https://github.com/gorhill/uBlock/commit/1abc864742
2024-10-05 07:41:44 -04:00
Raymond Hill
05ba71aef0
Make Firefox dev build auto-update 2024-10-04 13:30:54 -04:00
Raymond Hill
d24ffe6bb8
Import translation work from https://crowdin.com/project/ublock 2024-10-04 12:30:37 -04:00
Raymond Hill
fccda96bd7
New revision for dev build 2024-10-04 12:28:25 -04:00
Raymond Hill
5e2f94bebc
New revision for dev build 2024-10-04 12:27:57 -04:00
Raymond Hill
1abc864742
Add trusted-prevent-dom-bypass scriptlet
@description
Prevent the bypassing of uBO scriptlets through anonymous embedded context.

To ensure that a target method in the embedded context is using the
corresponding parent context's method (which is assumed to be
properly patched), or to replace the embedded context with that of the
parent context.

Root issue:
https://issues.chromium.org/issues/40202434

@param methodPath
The method which calls must be intercepted. The arguments
of the intercepted calls are assumed to be HTMLElement, anything else will
be ignored.

@param selector (optional)
A plain CSS selector which will be used in a `document.querySelector()`
call, to validate that the returned element must be processed by the
scriptlet. If no selector is provided, all elements will be processed.

@param targetMethod (optional)
The method in the embedded context which should be delegated to the
parent context. If no method is specified, the embedded context becomes
the parent one, i.e. all  properties of the embedded context will be that
of the parent context.
2024-10-04 12:24:35 -04:00
Raymond Hill
5133991f7e
Fix spurious error in content script
No guarantee vAPI.bootstrap will still be present when callback
executes.
2024-10-04 08:57:10 -04:00
Ilya (Marshal)
9f4123a4e2
Fix AdGuard Knowledge Base URLs 2024-10-04 11:27:24 +02:00
Raymond Hill
8196b99e9d
Make Firefox dev build auto-update 2024-10-03 13:51:14 -04:00
Raymond Hill
89a1fd5b0e
New revision for dev build 2024-10-03 13:42:24 -04:00
Raymond Hill
f3bc426a57
Update changelog 2024-10-03 13:42:03 -04:00
Raymond Hill
fe49ced2ac
Imrpove prevent-xhr scriptlet; add trusted-prevent-xhr scriptlet
Add support for synchronous `send()` calls.

`trusted-prevent-xhr` is essentially the same as `prevent-xhr` except
that if the `directive` argument is not a known token, it will be
used as is as the response text of the xhr request, whereas `prevent-xhr`
returns an empty string when the directive is unknown.
2024-10-03 13:31:52 -04:00
Raymond Hill
bcb31db176
Update changelog 2024-10-02 15:11:26 -04:00
Raymond Hill
b25d2153af
Make Firefox dev build auto-update 2024-10-02 15:05:42 -04:00
Raymond Hill
ce8cc4793c
Update changelog 2024-10-02 14:58:39 -04:00
Raymond Hill
99593f82f4
New revision for dev build 2024-10-02 14:58:31 -04:00
Raymond Hill
4305bfbdb1
Skip dns resolution when requests are proxied through http
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/discussions/3396

Reference:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/proxy/ProxyInfo#type_2
2024-10-02 14:51:26 -04:00
Raymond Hill
73ce4e6bcf
Blocking large media elements also prevents autoplay, regardless of size
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3394

When the "No large media elements" per-site switch is toggled on,
it will also act to prevent autoplay of video/audio media, regardless
of their size. This also works for xhr-based media streaming.

If blocking by size is not desirable while blocking autoplay is
desired, one can toggle on "No large media elements" switch while
setting "Block media elements larger than ..." to a very high value.
2024-10-02 13:39:36 -04:00
Raymond Hill
0b02c7ccb6
Import translation work from https://crowdin.com/project/ublock 2024-10-01 12:27:56 -04:00
Raymond Hill
6cac645830
Do not discard !#else block for unknown preprocessor tokens
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3393
2024-09-30 10:16:48 -04:00
Raymond Hill
3d6984aeaf
Import translation work from https://crowdin.com/project/ublock 2024-09-29 17:06:51 -04:00
Raymond Hill
63cf3dc959
Make Firefox dev build auto-update 2024-09-29 12:50:55 -04:00
Raymond Hill
c6baa2fb51
Import translation work from https://crowdin.com/project/ublock 2024-09-29 11:15:04 -04:00
Raymond Hill
7a9481b5a5
New revision for dev build 2024-09-29 10:57:12 -04:00
Raymond Hill
a2f81f19ff
Update changelog 2024-09-29 10:56:54 -04:00
Raymond Hill
e81e70937f
Add ability to decode base64 in urlskip=
Related case:
https://github.com/uBlockOrigin/uAssets/issues/25467

New step: `-base64`
Purpose: to decode base64-encoded output of previous step
2024-09-29 10:51:56 -04:00