AdguardTeam / AdguardTeam/Scriptlets

Improve 'prevent-xhr' — support redirect resources as response body

Đang mở
#350 2 bình luận 1 reaction 1 người được giao Được @maximtop nhận Xem trên GitHub
enhancement 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ả

### Expected and Actual Behaviors

![image](https://github.com/AdguardTeam/Scriptlets/assets/98787049/8ace927f-a91c-408c-9a5b-d57cba152f15)

They checks that `google-adsense` or `googlesyndication` exists in `XMLHttpRequest.prototype.responseText` via `jQuery.ajax.done`.
It can be resolved if a filter maintainer can use redirection resources in `prevent-xhr` scriptlet.

Add a parameter to `prevent-xhr` that accepts a redirect resource name (e.g., `googlesyndication-adsbygoogle`) to be returned as the XHR `response`/`responseText` body instead of an empty string. This is needed when pages check the XHR response content for specific strings (e.g., `aagag.com` checks for `google-adsense`/`googlesyndication` in `responseText` via `jQuery.ajax.done`) — currently an empty response causes the site to detect blocking and break.

### Environment
- Operating System: Ubuntu 23.04
- Web Browser: Mozilla Firefox Developer Edition 117.0b5
- AdGuard product: AdGuard Browser extension 4.1.57

### Additional Information

- https://piquark6046.github.io/testpage/XMLResponse-aagag/20230810/
- https://github.com/AdguardTeam/AdguardFilters/issues/158625
- https://github.com/List-KR/List-KR/issues/769

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.