Ublock: Problem with HTML filter

Created on 7 Apr 2018  路  10Comments  路  Source: gorhill/uBlock

Hello, I would like to block inline script with uBO using HTML filters & example.com##^script:has-text(...) filter. I am not able to do this, I do not know if there is a bug in uBO or if there is an error in my filter. Anyway, I kindly ask for help.

I did check #3255 and #3562 issues and the Inline script tag filtering, HTML filters documentation chapters to get more information.

The inline script I want to block definitely contains the text coinslider. I use uBO rule
correct-domain-here.tld##^script:has-text(coinslider)
The inline script is not being blocked. I also tried the several variants and another strings and keywords based on element IDs, all of them contained in the script body. No success though. Would anyone be so kind to check the rule and tell me if there is an error in it. Or to adjust the blocking rule based on the code snippet bellow. Or to check if there is a bug in the current versions of uBO eventually.

_Additional info:_
The script code of course looks more like this to better illustrate the context...
<script type="text/javascript">$(document).ready(function() {$('#slider1').coinslider({ SOME_PARAMS_HERE...

Tested on Firefox 59.0.2, FF 60.0b7, FF 60.0b10. uBlock Origin 1.15.18 and 1.15.24. The behaviour is the same for all FF & uBO versions.


EDIT1: HTML filters not working only for one particular website, cosmetic filters working fine on the same website. Limited to the one website only. Can not provide the data to reproduce, issue closed for this reason. Also editing the title of this thread.

Most helpful comment

No. HTML filtering is working only in firefox.

All 10 comments

I did check

Did you also check CONTRIBUTING?

There was the https://thephp.cc/welcome URL mentioned in the #3562. I used this website as a sandbox and I also used the GitHub main page as another sandbox. I did not try to filter inline script as there weren't any on the mentioned sites. I simply tried to filter a randomly selected HTML element.

  1. https://thephp.cc/welcome

    • <!DOCTYPE html>

    • Type: application/xhtml+xml

    • Render Mode: Standards compliance mode

    • cosmetic filters work

    • HTML filters work

  2. https://github.com/

    • <!DOCTYPE html>

    • Type: text/html

    • Render Mode: Standards compliance mode

    • cosmetic filters work

    • HTML filters work

  3. the page I want to block inline script

    • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" ...

    • Type: text/html

    • Render Mode: Standards compliance mode

    • cosmetic filters work

    • HTML filters do not work

Now it does not seem to be an error in the filter. No HTML filter work on the site. The site differs with XHTML 1.1 doctype from the others, where the HTML filters work fine.

the page I want to

Still no repro case. You make it impossible to investigate. Only you can investigate what you think is an issue, as far as I am concerned, no case has been made there is an issue. I thought this was clear from CONTRIBUTING. What should I add to make it clearer? Did you also read "How to Report Bugs Effectively" as suggested?

You mention #3652: did you see how this one came with a detailed reproducible case, and how I confirmed and fixed in less than a hour?

You try in Chrome use HTML Filtering?

Hello!
I have a same problem too. But my browser is Google Chrome 60.0.3112.90 (32bit). Can i hope that HTML Filtering will work in it?
Thanx.

No. HTML filtering is working only in firefox.

mapx-
Ok, thank you. Any chances for applying this feature in Chrome in future?

I cannot see this code in "view-source:`https://thephp.cc/welcome`": > `

Related issues

GSNord picture GSNord  路  3Comments

ghost picture ghost  路  3Comments

Gitoffthelawn picture Gitoffthelawn  路  3Comments

thebigsmileXD picture thebigsmileXD  路  3Comments

rvandermeulen picture rvandermeulen  路  4Comments