Repository navigation
HTML filters occasionally lost effectiveness #42
Description
Activity
One other thing...
I mistaked the outdated fork source of fang5566/uBlock , which is the offical Chinese (中文) introduction&wiki , and posted uBlock-LLC/uBlock#1767 .
Then I got a ban at https://github.com/gorhill/uBlock/issues/new for that misposted issue.
WHY???
There is no ban on
https://github.com/gorhill/uBlock/issues/new, it's just reserved to contributors. Here is the proper issue tracker.I answered to you on uBlockAdmin (which is a scammy fork by the way):
When I
view-sourceyour URLhttps://www.baidu.com/s?wd=%E7%9A%AE%E9%9E%8B, I get:<!DOCTYPE html>
<!--STATUS OK-->No
scriptin there.Duh, sorry, I didn't realize I could scroll. I will investigate.
Ok, again, when I
view-sourceyour URLhttps://www.baidu.com/s?wd=%E7%9A%AE%E9%9E%8B, I can't find any instance ofecomScriptin the source.@Crystal-RainSlide HTML filtering will only match what is in seen in
view-source:, not what is dynamically added afterward.@gwarser Yes, cofirmed it works fine with
www.baidu.com##^script#head_script, the script element is present inview-source:, and I confirmed it was properly removed by the above filter, so the syntax works, it's just a matter of filtering what is present in the source data as perview-source:.- addedunable to reproducecannot reproduce the issuecannot reproduce the issue
on May 15, 2018 When I tested this earlier ecomScript was present, but disappeared after refresh or two.
Still there on my end - https://i.imgur.com/xZr5QIe.jpg Can't reproduce though, it blocks just as expected.
script:contains()is only supported on Firefox-legacy branch, you must have installed that build instead of WebExtension build.##script:contains()is deprecated syntax, it is internally converted to##^script:has-text()-- true for either Firefox legacy or webext.10 remaining items
- changed the title
[-]HTML filters (example.com##^.badstuff) occasionally lost effectiveness (reproducing...)[/-][+]HTML filters (example.com##^.badstuff) occasionally lost effectiveness[/+]on May 16, 2018 - changed the title
[-]HTML filters (example.com##^.badstuff) occasionally lost effectiveness[/-][+]HTML filters occasionally lost effectiveness[/+]on May 16, 2018 I can reproduce every time and
#headappears in theview-sourceof both tabs -- original and duplicate.view-source:is to be used to find out what can be filtered, not what has been filtered. Firefox bypasses uBO when requesting a page viaview-source:.You're right, I just tested
##.cr-contentwithbaidu.com##^.cr-contentand it works as expected.Then, Chrome... Note that I'm using Cent Browser, not offical Chrome.
HTML filtering is not supported on Chromium-based browsers, it's missing the proper API.
I can reproduce sporadically when using the "duplicate tab" trick. When the issue occurs, the HTML filter is not reported in the logger. I will keep investigating.
Yes, I was looking at this: https://bugzilla.mozilla.org/show_bug.cgi?id=1376932.
I confirm that when the issue occurs, uBO's onHeadersReceived listener is not being called at all, Firefox bypasses uBO, hence uBO can't do its job.
So this is a browser bug ?
Yes, but I need to provide a workaround given the seriousness of it: one main use of HTML filtering is to remove unwanted specific inline script tag, and the issue here means this could lead to unwanted inline script code being executed. Beside, this should also solve the issue described in https://bugzilla.mozilla.org/show_bug.cgi?id=1376932 -- NoScript is being mentioned but uBO does also suffers from it (also uMatrix: gorhill/uMatrix#893).
Prerequisites
Description
An ad script in
https://www.baidu.com/s?wd=%E7%9A%AE%E9%9E%8BI tried to remove it with
www.baidu.com##^script#ecomScript, but I found that onlyscript:contains()is supported.Then I took some time with the code and got 'setAdsHeight' in the js outline from Firefox's dev tools, then everything works fine, but the time has gone.
Certainly CSS Selector don't support this, but adblocks may support it for simplifing the rules&filtering.
A specific URL where the issue occurs
All website equipped with
<script foo="bar">Steps to Reproduce
Descripted↑
Expected behavior:
example.com##script#id
Actual behavior:
Nothing happens & desired filter don't work
Your environment