AdguardTeam / AdguardTeam/Scriptlets

Fix trusted scriptlets injection — AdGuard for iOS Pro cannot inject some trusted scriptlets and JS rules

Aperta
#302 0 commenti 0 reazioni 1 assegnatario Assegnata a @maximtop Vedi su GitHub
bug Priority: P4
Lingua principale
JavaScript
Stelle
195
Fork
33
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Summary
A video player in m.tv.nate.com does not work if the following trusted scriptlets or javascript rule are applied:
```adblock
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')
```
```adblock
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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.