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

set-constant.js scriptlet have stopped working (v1.25.3b2) #947

Closed
dimisa-RUAdList opened this issue Mar 16, 2020 · 10 comments
Closed

set-constant.js scriptlet have stopped working (v1.25.3b2) #947

dimisa-RUAdList opened this issue Mar 16, 2020 · 10 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@dimisa-RUAdList
Copy link

Google Chrome 80.0.3987.132

uBlock Origin
default + RU AdList + Counters (https://easylist-downloads.adblockplus.org/cntblock.txt)

Compare the work of versions 1.25.3b2 and 1.24.4 on sites:

https://www.rambler.ru/
https://trucks.ati.su/
https://news.mail.ru/economics/40959222/?frommail=1
https://it-actual.ru/securely-erase-hard-drive.html
https://video.khl.ru/quotes/695965
https://www.championat.com/boxing/_boxpro.html

Rules set-constant.js, *, undefined - behave very strange.

@gwarser
Copy link
Member

gwarser commented Mar 16, 2020

Can you be more specific?

How this works:

mail.ru##+js(set-constant, Object.prototype.ad/rectangle, undefined)
mail.ru##+js(set-constant, Object.prototype.ad/tgb, undefined)
mail.ru##+js(set-constant, Object.prototype.extension/bubble-home, undefined)

?

I checked few other prefs and seems to be set correctly.

@uBlock-user uBlock-user added the something to address something to address label Mar 16, 2020
@ediowar
Copy link

ediowar commented Mar 16, 2020

Most likely, you need the Russian ip and the language of the browser.

@uBlock-user
Copy link
Contributor

behave very strange.

What does this mean ? Website can act strange depending on the value you set.

@uBlock-user
Copy link
Contributor

Consider using null instead of undefined on such websites and see if you can still reproduce the strange behaviour you mentioned.

@ediowar
Copy link

ediowar commented Mar 16, 2020

It started from commit gorhill/uBlock@14ebfbe

@gorhill
Copy link
Member

gorhill commented Mar 16, 2020

I can reproduce a difference on https://video.khl.ru/quotes/695965. I get the same behavior when I revert gorhill/uBlock@14ebfbe#diff-d7616deaf3a39e3f19f8d70d098bfe7a.

@gorhill
Copy link
Member

gorhill commented Mar 16, 2020

So apparently Object.prototype instanceof Object is false -- I didn't expect this.

gorhill added a commit to gorhill/uBlock that referenced this issue Mar 16, 2020
Related issue:
- uBlockOrigin/uBlock-issues#947

`Object.prototype` is not an instance of `Object`, but
yet is still a JS object; thus the solution is to
additionally compare against `typeof`.
@dimisa-RUAdList
Copy link
Author

dimisa-RUAdList commented Mar 16, 2020

1.25.3b2 vs 1.24.4 >

https://www.rambler.ru/ -
https://i.imgur.com/EQ06Rl9.jpg vs https://i.imgur.com/d1YWwmm.jpg
rambler.*##+js(set-constant, Object.prototype.getPrefixes, undefined)

https://trucks.ati.su/ -
https://i.imgur.com/L5BR8lZ.jpg vs https://i.imgur.com/SQ3V2oi.jpg
ati.su##+js(set-constant, Object.prototype.checkBannerItem, undefined)

https://news.mail.ru/economics/40959222/?frommail=1 -
https://i.imgur.com/P3ChdNr.jpg vs https://i.imgur.com/FJORozn.jpg
mail.ru##+js(set-constant, Object.prototype.mimic, undefined)

Etc...

Using null instead of undefined does not solve the problem.

@gorhill
Copy link
Member

gorhill commented Mar 16, 2020

Issue is fixed in 1.25.3b3.

@dimisa-RUAdList
Copy link
Author

Now all is well!

@uBlock-user uBlock-user added bug Something isn't working fixed issue has been addressed and removed something to address something to address labels Mar 16, 2020
gorhill added a commit to gorhill/uBlock that referenced this issue Mar 16, 2020
Related commit:
- 40ea9d69d5d0

Related issue:
- uBlockOrigin/uBlock-issues#947

Restore intended behavior with original commit:
- 14ebfbea279c

The purpose of the original change was to be able to
trap properties which values were `null`.
JustOff pushed a commit to gorhill/uBlock-for-firefox-legacy that referenced this issue Jun 20, 2020
Related issue:
- uBlockOrigin/uBlock-issues#947

`Object.prototype` is not an instance of `Object`, but
yet is still a JS object; thus the solution is to
additionally compare against `typeof`.
JustOff pushed a commit to gorhill/uBlock-for-firefox-legacy that referenced this issue Jun 20, 2020
Related commit:
- gorhill/uBlock@40ea9d69d5d0

Related issue:
- uBlockOrigin/uBlock-issues#947

Restore intended behavior with original commit:
- gorhill/uBlock@14ebfbea279c

The purpose of the original change was to be able to
trap properties which values were `null`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

5 participants