AdguardTeam / AdguardTeam/Scriptlets

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

Đang mở
#302 0 bình luận 0 reaction 1 người được giao Được giao cho @maximtop Xem trên GitHub
bug Priority: P4
Ngôn ngữ chính
JavaScript
Star
195
Fork
33
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.