AdguardTeam / AdguardBrowserExtension

AdGuard browser extension
https://adguard.com/
GNU General Public License v3.0
3k stars 321 forks source link

Safari add-on blocks whole websites because of $subdocument modifier #145

Closed Freida-Moo-Goo-Gai-Pan closed 8 years ago

Freida-Moo-Goo-Gai-Pan commented 8 years ago

With the easy list enabled, it blocks redtube, youporn, youjizz, etc. Any of those types of sites show ":blank" in the address bar and do not load. This only happens using the easy list in Adguard and not in other blockers.

ameshkov commented 8 years ago

Problematic rules are:

||devicemag.com^$subdocument,~third-party
||eporner.com^$subdocument,~third-party
||pornvideoxo.com^$subdocument,~third-party
||tube8.com^$subdocument,~third-party
||youjizz.com^$subdocument,~third-party
||youporn.com^$subdocument,~third-party

Content Blocker does not provide a special type for matching iframes, so in our case $subdocument matches any document.

Conversion result example:

{
    "trigger": {
        "url-filter": "^https?://([^/]*\\.)?youporn\\.com[/:&?]?",
        "resource-type": [
            "document"
        ],
        "load-type": [
            "first-party"
        ]
    },
    "action": {
        "type": "block"
    }
}
ameshkov commented 8 years ago

Temporary solution - do not convert $subdocument rules without $third-party modifier

ameshkov commented 8 years ago

I've filed a feature request to webkit: https://bugs.webkit.org/show_bug.cgi?id=153559

For now we'll use the suggested workaround, but I hope the "subdocument" resource type will be added to webkit.

Fix will be included into the next beta version.