AdguardTeam / AdguardTeam/Scriptlets

Improve 'abort-current-inline-script' — do not block scripts injected by other extensions

Đang mở
#506 0 bình luận 0 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ả

In the default AgGuard filters, there is a rule like `...#%#//scriptlet('abort-current-inline-script', 'globalThis', 'break;case')` (from [here](https://github.com/AdguardTeam/AdguardFilters/blob/6a85024f295ab75ff901d28a479314a45df97cbb/BaseFilter/sections/general_extensions.txt#L252)). This prevents the TamperMonkey extension to load user scripts on the target sites because the script that extension injects uses the `globalThis` property (which raises an error as soon as it is accessed). This rule is used on many sites. Disabling AdGuard for these sites fixes the problem for TM.

Scripts injected by other browser extensions should not be blocked, as they are safe by definition (because the user installed the extensions). Maybe find a way to detect if the script accessing the property to be blocked has been injected by another extension, before deciding to raise an error?

Related TM issue is [here](https://github.com/Tampermonkey/tampermonkey/issues/2323#issuecomment-2959981133).

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.