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

script:contains is not working after page reload #2015

Closed
Pzixel opened this issue Sep 21, 2016 · 15 comments
Closed

script:contains is not working after page reload #2015

Pzixel opened this issue Sep 21, 2016 · 15 comments
Labels

Comments

@Pzixel
Copy link

Pzixel commented Sep 21, 2016

I have a site which I like to read, but yesterday they added anti-adblock inline script which blocks a page with disable adblock message.

Firstly I disabled inline scripts and it worked. But then I found that onclick handlers are not working. So i started to google something for specific and found script:contains filter which was exactly what I was looking for. But it works for only first load of the page, then scripts continues to work.

Sample page: https://forums.overclockers.ru/viewtopic.php?f=123&t=564019

When you firsly load the page it loads fine, but any reload will display the same message.
Debugger shows that it evals forbidden script:
image

My filters:

www.overclockers.ru###script:contains(Adblock)
forums.overclockers.ru###script:contains(Adblock)
*.overclockers.ru###script:contains(Adblock)
overclockers.ru###script:contains(Adblock)
www.overclockers.ru##script:contains(Adblock)
forums.overclockers.ru##script:contains(Adblock)
*.overclockers.ru##script:contains(Adblock)
overclockers.ru##script:contains(Adblock)

I have no other extensions to interfer with uBlock.

To reproduce:

  1. Add filters as showed above. It should block any inline script with Adblock text within
  2. Visit the page using link above.
  3. If page is not loaded yet, reload the page

Chrome 53 + uBlock 1.9.4, Windows 10 x64

As I said before, toggling disable all inline scripts option works, so it's an issue with very this script.contains.

@Pzixel Pzixel changed the title script:contains not working after page reload script:contains is not working after page reload Sep 21, 2016
@gwarser
Copy link
Contributor

gwarser commented Sep 21, 2016

### -> ##

@Pzixel
Copy link
Author

Pzixel commented Sep 21, 2016

Thank you for pointing it out, but unfortunly it doesn't affect described behaviour.

@F4z
Copy link

F4z commented Sep 21, 2016

If I understand correctly script:contains does not work in Chrome - https://github.com/gorhill/uBlock/wiki/Inline-script-tag-filtering#caveats

@Pzixel
Copy link
Author

Pzixel commented Sep 21, 2016

@F4z damn, I scrolled the page until first example (and this text is before it), so I skipped it... It seems that issue should be closed/deleted. But before we did it: Is there some workaround? For example if I understand properly, for example I can override jQuery html method and block whatever I want, but only in case when script:inject is working (I think it doesn't in chromium-based). There could be other workarounds. If you have any, please advice.

@Pzixel
Copy link
Author

Pzixel commented Sep 21, 2016

"Starring the related Chromium issue may help motivate Chromium devs to implement support." (с) docs
I think it's useless, bug is closed as won't fix. We can forget about afterscriptexecute in chromium forever.

@F4z
Copy link

F4z commented Sep 21, 2016

With my filter lists I do not have message to disable adblock, but I see asus ad on this forum.
I do not know which filter list you use, but probably one rule from your lists block this asus ad, so you should whitelist it and hide it in other way.
For example:
forums.overclockers.ru##object[data="/asus_kino_240_400v2.swf"]:style(height: 0px !important;)

Or you can enable "RUS: Adguard Russian Filter‎" in this list is this rule to hide this ad:
overclockers.ru#$#object[width="240"][height="400"] { position: absolute!important; left: -2000px!important; }

@uBlock-user
Copy link
Contributor

Read this for more details on why Chromium devs chose not to include it - whatwg/html#943

@Pzixel
Copy link
Author

Pzixel commented Sep 22, 2016

@uBlock-user yes I see:

So if I understand correctly, google can control the standards by simply choosing to not implement what it doesnt like in chrome?

It seems they refused to add it because they feel web site developers should have control in what appears in the end user's browser.

@gorhill
Copy link
Owner

gorhill commented Sep 22, 2016

In the thread, it was suggested that the ability to block script in a manner similar to beforescriptexecute was more appropriate from extension API-side. I kind of agree with this, because this would give extensions the upper hand over web site code (the same way user styles in FF have the upper hand over author styles) -- now the only obstacle is to convince developers (FF/Chromium) to provide support on the extensions API side.

@uBlock-user
Copy link
Contributor

If I understand correctly, if they provide support for this through extensions API side, then this feature can be implemented in Chromium too ?

@gorhill
Copy link
Owner

gorhill commented Sep 22, 2016

Yes.

@uBlock-user
Copy link
Contributor

Good to know, speaking of chromium, uBO is not getting updated on Chrome Web Store since version 1.9.4, even though you released 1.9.6 weeks ago, can you look into that ?

@gorhill
Copy link
Owner

gorhill commented Sep 22, 2016

If all seems well later today with FF 1.9.8, I will submit to the Chrome/Opera stores.

@uBlock-user
Copy link
Contributor

uBlock-user commented Sep 22, 2016

So you're going to skip 1.9.6 and directly upload 1.9.8 after 1.9.4 to chrome store later ?

@gorhill
Copy link
Owner

gorhill commented Sep 22, 2016

Yes, there was not much high profile fixes for Chromium-based browser in 1.9.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants