AdguardTeam / AdguardTeam/Scriptlets

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

Abierto
#302 0 comentarios 0 reacciones 1 asignado Asignado a @maximtop Ver en GitHub
bug Priority: P4
Lenguaje dominante
JavaScript
Estrellas
195
Forks
33
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.