-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Labels
Priority: P4Release: v2.0.1Resolution: FixedStatus: ClosedVersion: Scriptlets v2.0enhancementImprovement of existent featureImprovement of existent feature
Description
Basically the same issue as here - #199 (comment), but for response (currently only responseText is modified).
Steps to reproduce:
- Add this rule:
example.org#%#//scriptlet('prevent-xhr', 'pagead2.googlesyndication.com')
- Go to - https://example.org/
- Run this script:
(() => {
function reqListener() {
if (this.status !== 200 || this.responseText === "" || this.response === "") {
alert("adblock");
} else {
(() => {
let video = '<iframe width="560" height="315" src="proxy.php?url=https://www.youtube.com/embed/Fy2rtb95QhY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
let createDiv = document.createElement("div");
document.body.appendChild(createDiv);
createDiv.innerHTML = video;
})();
}
}
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", reqListener);
oReq.open("GET", "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js");
oReq.send();
})();Alert will be displayed, because this.response returns "".
If pagead2.googlesyndication.com/pagead/js/adsbygoogle.js is not blocked then video player is loaded.
In this line:
Scriptlets/src/scriptlets/prevent-xhr.js
Line 206 in 804c535
| response: { value: modifiedResponse, writable: false }, |
if
response is a text then it probably should be set to modifiedResponseText.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Priority: P4Release: v2.0.1Resolution: FixedStatus: ClosedVersion: Scriptlets v2.0enhancementImprovement of existent featureImprovement of existent feature