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

Scriptlets should handle escaped quotes correctly #286

Closed
maximtop opened this issue Jan 25, 2023 · 0 comments
Closed

Scriptlets should handle escaped quotes correctly #286

maximtop opened this issue Jan 25, 2023 · 0 comments

Comments

@maximtop
Copy link
Contributor

These pairs should work the same way

rules pair

#%#//scriptlet("prevent-setTimeout", ".css('display','block');")

#%#//scriptlet('prevent-setTimeout', '.css(\'display\',\'block\');')

should block setTimeout with stringified callback containing the next substring:

.css('display','block');

and pair

#%#//scriptlet("prevent-setTimeout", ".css(\"display\",\"block\");")

#%#//scriptlet('prevent-setTimeout', '.css("display","block");')

should block setTimeout with stringified callback containing the next substring

.css("display","block");

How to check if they work

  1. add a rule #%#//scriptlet('prevent-setTimeout', '.css(\'display\',\'block\');')
  2. go to any site, run in the console
setTimeout(() => { console.log(`.css('display','block');`)}, 500);

set timeout should not be executed

after that

  1. add a rule #%#//scriptlet('prevent-setTimeout', ".css('display','block');")
  2. go to any site, run in the console
setTimeout(() => { console.log(`.css('display','block');`)}, 500);

set timeout should not be executed

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

4 participants