Commit Graph

12734 Commits

Author SHA1 Message Date
Raymond Hill a80c749096
Make Firefox dev build auto-update 2024-10-07 12:05:41 -04:00
Raymond Hill f825a65f8e
New revision for dev build 2024-10-07 12:00:21 -04:00
Raymond Hill 4aae1bdf47
Minor code review 2024-10-07 11:56:22 -04:00
Raymond Hill daa62c3081
Update README for npm package 2024-10-07 08:56:34 -04:00
Raymond Hill 9a286495a5
New npm version 2024-10-07 08:49:09 -04:00
Raymond Hill 34508a1c2d
Add demo.js to npm build
To help people to get quickly started with using the package.
2024-10-07 08:47:45 -04:00
Raymond Hill 26c0aa357e
New npm version 2024-10-07 07:38:41 -04:00
Raymond Hill 013e6db6ef
Fix typo 2024-10-06 17:05:44 -04:00
Raymond Hill acf7f39a60
New revision for npm package 2024-10-06 17:04:08 -04:00
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