AdguardTeam / AdguardBrowserExtension

AdGuard browser extension
https://adguard.com/
GNU General Public License v3.0
3.07k stars 329 forks source link

Style filter is applied, but scriptlet filter is not in Firefox #2782

Closed zenstorage closed 2 months ago

zenstorage commented 6 months ago

AdGuard Extension version

4.3.35

Browser version

Chrome 123 / Firefox 124

OS version

Windows 11

What filters do you have enabled?

No filters

What Stealth Mode options do you have enabled?

No response

Issue Details

In these filters:

twitter.com##+js(json-prune-xhr-response, data.user.result.timeline_v2.timeline.instructions.[].entries.[].content.items.[].item.itemContent.tweet_results.result.legacy.possibly_sensitive, , propsToMatch, url:/UserMedia)
twitter.com##+js(rmnt, #text, /./)
twitter.com##div:style(border: 1px solid red !important;)

The style filter is applied in Chrome and FIrefox, but the scriptlet filter is not applied in FIrefox, I have already tried using the Adguard and ABP syntax but it has the same result,I let something go?

Expected Behavior

Scriptlet filter to be applied

Screenshots

All filters working in Chrome:

chrome: ![chrome](https://github.com/AdguardTeam/AdguardBrowserExtension/assets/82182314/34613730-8202-4a41-8534-9f76cf1d58c7)

Only style filter working in Firefox:

firefox: ![firefox](https://github.com/AdguardTeam/AdguardBrowserExtension/assets/82182314/cc088406-c00d-41ec-84b8-86e96d954273)

Additional Information

No response

slavaleleka commented 6 months ago

rmnt scriptlet should work fine

but json-prune-xhr-response is not available in the extension v4.3.35, it was added in Scriptlets v1.10.25 and available in AdGuard Browser extension v4.3.46

AdamWr commented 6 months ago

I think that the problem is related to - https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1733 and any scriptlet/JavaScript rule doesn't work with extension for Firefox on twitter.com, because it's blocked by website's Content Security Policy.

Any chance for prioritizing this task? - https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1733

As I recall, similar issue is in AdGuard MV3 version - https://github.com/AdguardTeam/AdGuardMV3/issues/57

maximtop commented 6 months ago

Thanks, @AdamWr

Indeed, it seems like the problem is with the CSP, since scriptlet rules are working in Firefox—take example.org, for example.

Any chance for prioritizing this task? - #1733

I've moved it to v4.4.