-
Notifications
You must be signed in to change notification settings - Fork 85
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
Use safe Function.prototype.toString() in scriptlets #2907
Comments
I would prefer to fix on a per-scriptlet basis, to minimize the chance of unforeseen breakage -- especially that I want the current dev build to enter release candidate mode. I fixed the case of Ok I also added |
There are 17 filters in uBO With this here change, we might need to update those filters. I'll check them in a few days. |
Fixed all instances I could test. I'll close this issue after the next stable release is widespread. |
Related: AdguardTeam/Scriptlets#481 |
Related feedback: uBlockOrigin/uBlock-issues#2907 (comment)
Some sites (or libraries) tamper with
Function.prototype.toString
which is used in these scriptlets to match against the handler function:addEventListener-defuser
,no-setInterval-if
,no-setTimeout-if
,adjustSetInterval
,adjustSetTimeout
,noeval-if
Example 1
Add:
Visit:
https://noorlib.ir/book/view/30999?pageNumber=10&viewType=pdf
See in console:
Use this userscript:
See in console:
The tampered
toString()
:Example 2
On
soft98.ir
, enter in console:See "function() { [native code] }" instead of "() => {}".
The tampered
toString()
:"function(){return en()}"
Example 3
On
extremereportbot.com
, enter in console:See
function toString(){return"function"==typeof this&&this[a]||e.call(this)}
instead of"function toString() { [native code] }"
gorhill/uBlock#3901
The text was updated successfully, but these errors were encountered: