-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve prevent-xhr
scriptlet
#199
Comments
Makes perfect sense, thank you! More info on the XHR events: |
By the way, maybe we could also add additional option to generate random Scriptlets/src/scriptlets/prevent-xhr.js Line 121 in 8877b08
As I recall, there was a website which was checking if Steps to reproduce:
(() => {
function reqListener() {
if (this.status !== 200 || this.responseText === "") {
alert("adblock");
} else {
(() => {
let video = '<iframe width="560" height="315" src="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 |
Merge in ADGUARD-FILTERS/scriptlets from fix/AG-13007 to release/v1.6 Squashed commit of the following: commit 592df06 Merge: 7f2ba38 e724ea1 Author: Stanislav A <[email protected]> Date: Tue Mar 15 15:45:21 2022 +0300 Merge branch 'release/v1.6' into fix/AG-13007 commit 7f2ba38 Author: Slava Leleka <[email protected]> Date: Tue Mar 15 13:15:15 2022 +0300 typo edited online with Bitbucket commit 3234f68 Author: Slava Leleka <[email protected]> Date: Tue Mar 15 13:15:04 2022 +0300 typo edited online with Bitbucket commit 0d746a5 Author: Stanislav A <[email protected]> Date: Tue Mar 15 13:10:19 2022 +0300 update description & fix param usage commit 006bb77 Author: Stanislav A <[email protected]> Date: Tue Mar 15 12:20:56 2022 +0300 improve prevent-xhr scriptlet
* commit 'c06a8e539488e1ebfcf72c85a39a0ef5b9c028bb': (32 commits) AG-13382 update docs, validate noopjson push updated dist to github while release build. AG-13356 remove tagcommander redirect AG-11959 add readme info about testing ad debugging AG-12716 add artifacts to scriptlets builds AG-12487 improve set-constant scriptlet #65 AG-149 improve prevent-xhr scriptlet #199 AG-13007 improve googletagservices-gpt redirect #193 AG-12767 add wcslog redirect #94 AG-3906 improve ati-smarttag redirect #200 AG-13141 improve json-prune scriptlet #171 AG-11879 fix yandex metrika on avito #198 AG-12973 improve metrika-yandex-tag redirect #189 AG-12550 add prebid-ads redirect #190 AG-12558 remove no-floc scriptlet AG-12869 add noopjson redirect. AG-12796 #195 Revert "revert tests and fix converter again" revert tests and fix converter again add conversion test for wildcard tld AG-12636 add prevent-element-src-loading scriptlet #180 AG-12328 ...
@gorhill Need to do the same for |
There is a website - AdguardTeam/AdguardFilters#111383 which detects adblockers when
googletagmanager.com/gtag/
(xmlhttprequest) is blocked.Unfortunately,
streamingcommunity.site#%#//scriptlet('prevent-xhr', 'googletagmanager.com')
doesn't work correctly in this case and video player is broken.If I'm not wrong, it's because website uses
loadend
event, so I guess that adding:here:
Scriptlets/src/scriptlets/prevent-xhr.js
Lines 128 to 134 in 8877b08
should fixes this issue.
The text was updated successfully, but these errors were encountered: