Steps to reproduce:
- Add this rule:
example.org#%#//scriptlet('trusted-replace-fetch-response', 'ads', '', 'ad_url_test')
- Go to - https://example.org/
- Run in browser console:
(async () => {
const e = '{"ads":true}';
const l = btoa(e);
const m = "data:application/json;base64," + l;
const p = new Request(m);
Object.defineProperty(p, "url", {
get: function () {
return "https://www.example.org/ad_url_test";
}
});
const test = await fetch(p);
const text = await test.text();
if (!text.includes('ads')) {
alert('adblock');
}
})();
With current version of the scriptlet there will be an alert displayed, but it should not be and the content should not be replaced, because it's a data URL request (data:application/json;base64,...) with url set by Object.defineProperty.
Steps to reproduce:
With current version of the scriptlet there will be an alert displayed, but it should not be and the content should not be replaced, because it's a data URL request (
data:application/json;base64,...) withurlset byObject.defineProperty.