Prerequisites
I tried to reproduce the issue when...
Description
We need to expand syntax of prevent-xhr, prevent-fetch, trusted-prevent-fetch and trusted-prevent-xhr scriptlet by allowing specifying HTTP status code and modifying an HTTP header for XHR and fetch API.
For example, by executing the following code without adblocking, you can receive 0 as its HTTP status code:
(await fetch('https://www3.doubleclick.net', { method: 'HEAD', mode: 'no-cors', cache: 'no-store' })).status
However, the following none of scriptlet filters work:
example.com##+js(no-fetch-if, doubleclick.net, , '{"statusText": ""}')
example.com##+js(no-fetch-if, doubleclick.net, , '{"type": "opaque"}')
example.com##+js(no-fetch-if, doubleclick.net)
because uBO returns 200.
Also, removing, modifying and adding an HTTP response header & its value is required.
A specific URL where the issue occurs.
Steps to Reproduce
- Apply each the provided scriptlet filter
- Visit https://example.com/
- Execute the provided code.
Expected behavior
Return 0.
Actual behavior
Return 200.
uBO version
1.66.4
Browser name and version
Firefox Dev 144.0b9 flatpak
Operating System and version
Ubuntu 25.10
Prerequisites
I tried to reproduce the issue when...
Description
We need to expand syntax of
prevent-xhr,prevent-fetch,trusted-prevent-fetchandtrusted-prevent-xhrscriptlet by allowing specifying HTTP status code and modifying an HTTP header for XHR and fetch API.For example, by executing the following code without adblocking, you can receive
0as its HTTP status code:However, the following none of scriptlet filters work:
because uBO returns
200.Also, removing, modifying and adding an HTTP response header & its value is required.
A specific URL where the issue occurs.
https://srank.kr/Steps to Reproduce
Expected behavior
Return
0.Actual behavior
Return
200.uBO version
1.66.4
Browser name and version
Firefox Dev 144.0b9 flatpak
Operating System and version
Ubuntu 25.10