Scriptlets
Scriptlets copied to clipboard
AdGuard for iOS Pro cannot inject some trusted scriptlets and javascript rules
Summary
A video player in m.tv.nate.com does not work if the following trusted scriptlets or javascript rule are applied:
tv.nate.com#%#//scriptlet('trusted-replace-xhr-response', '"response":"video"', '"response":null', 'tv.nate.com/api/v1/ad?adType')
tv.nate.com#%#//scriptlet('trusted-replace-xhr-response', '/"videoAdList":\[.*\](?=,"textAdList")/', '"videoAdList":null', 'tv.nate.com/api/v1/ad?adType')
tv.nate.com#%#//scriptlet('trusted-replace-xhr-response', '/"textAdList":\[.*\]/', '"textAdList":null', 'tv.nate.com/api/v1/ad?adType')
tv.nate.com#%#AG_onLoad(() => { var BuildObs, PlayerObs; let PlayerCall = (mutationList, observer) => { mutationList.forEach((e) => { if (Array.from(e.target.classList).some((e) => { return e === "ntv-ad-playing" })) { player.trigger("adended"); PlayerObs.disconnect() }})}; let BuildCall = (mutationList, observer) => { mutationList.forEach((e) => { Array.from(e.addedNodes).filter((o) => { return o.id === "natePlayer" }).forEach((k) => { PlayerObs = new MutationObserver(PlayerCall); PlayerObs.observe(k, { attributes: true }); BuildObs.disconnect() })})}; BuildObs = new MutationObserver(BuildCall); BuildObs.observe(document.querySelector(".player-wrapper"), { childList: true }) })
How to reproduce
https://drive.google.com/drive/folders/1S8UI5yXe5-1QP0hv5t9BN87txujLJvt4?usp=sharing
Related Issue, PR and Slack thread
- https://performix.slack.com/archives/C21CVC354/p1679911265095139
- https://github.com/AdguardTeam/FiltersRegistry/pull/766/
- https://github.com/List-KR/List-KR/issues/654