Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new scriptlet — 'trusted-suppress-native-method' #383

Closed
Alex-302 opened this issue Dec 1, 2023 · 3 comments
Closed

Add new scriptlet — 'trusted-suppress-native-method' #383

Alex-302 opened this issue Dec 1, 2023 · 3 comments

Comments

@Alex-302
Copy link
Member

Alex-302 commented Dec 1, 2023

Example, where it may be useful - site checks _egoTab key and it's value.
Actually more sites like this, since we can block in other ways. But this method can speed up rule creation.

  • @AdamWr 's JS rule for this purpose works on https://www.baeldung.com/kotlin/let-vs-if-not-null
    #%#!function(){const e={apply:(e,o,t)=>{if(t[0]&&t[0].includes("fs.adb"))throw new Error;return Reflect.apply(e,o,t)}};window.localStorage.setItem=new Proxy(window.localStorage.setItem,e)}();
@Alex-302 Alex-302 changed the title Add new scriptlet abort-on-localStorage-read Add new scriptlet abort-on-localStorage-read / '-write' Dec 1, 2023
@Alex-302 Alex-302 changed the title Add new scriptlet abort-on-localStorage-read / '-write' Add new scriptlet abort-on-localStorage-read / -write Dec 1, 2023
@slavaleleka slavaleleka added the Feature request Adding new feature label Dec 25, 2023
@AdamWr
Copy link
Member

AdamWr commented Jan 8, 2024

What do you think about making it a more generic scriptlet?
I mean that instead of just localStorage it could be any property (similar like it's done in trusted-prune-inbound-object scriptlet) and if it would contains specific argument, then it could be aborted.

@Alex-302
Copy link
Member Author

Alex-302 commented Jan 9, 2024

@AdamWr Maybe it is a good idea, but in this case it could be used only in our (trusted) filters.

@ameshkov
Copy link
Member

ameshkov commented Jan 9, 2024

I actually think that "abort" scriptlets are relatively safe and we can make it generally available

@adguard-bot adguard-bot assigned slavaleleka and unassigned maximtop Jan 26, 2024
@adguard-bot adguard-bot changed the title Add new scriptlet abort-on-localStorage-read / -write Add new scriptlet trusted-suppress-native-method Mar 21, 2024
@adguard-bot adguard-bot changed the title Add new scriptlet trusted-suppress-native-method Add new scriptlet 'trusted-suppress-native-method' Mar 22, 2024
@adguard-bot adguard-bot changed the title Add new scriptlet 'trusted-suppress-native-method' Add new scriptlet — 'trusted-suppress-native-method' Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants