jspenguin2017 / uBlockProtector

An anti-adblock defuser for Nano Adblocker and uBlock Origin
GNU General Public License v3.0
744 stars 82 forks source link

NSFW! gelbooru.com #182

Closed Aurani closed 7 years ago

Aurani commented 7 years ago

Not sure if this issue is because the site itself improved their anti-adblock script or because something broke in the last daily update to your script, regardless. As of today (it worked fine about 3h ago) I'm unable to view any images on this site, disabling uBlockO makes the images view as normal, disabling your script does nothing however. Example

And before you ask, no, I've not made any changes to my browser (Waterfox) or anything uBlock related.

jspenguin2017 commented 7 years ago

Yes, looks like the website got a new ad block detection script. image

Last time I updated Script was this morning, this is my commit: https://github.com/jspenguin2017/AdBlockProtector/commit/31a4d12985a68a5684a2dd3a71d1481343e033e9 The new code will only run on gaana.com domain.

okiehsch commented 7 years ago

As of today (it worked fine about 3h ago) I'm unable to view any images on this site

Update your uBO-filters list, then you should be able to view the images again. Fixed with https://github.com/uBlockOrigin/uAssets/commit/30d69ebf1c3000f8598debf009ac4ee30e0abb12

jspenguin2017 commented 7 years ago

@okiehsch Yep, that works!

uBlock-user commented 7 years ago

The images can be seen but the notice wasn't removed.

Add - gelbooru.com###nup

kowith337 commented 7 years ago

Hi, it's maybe not entirely anti-adblock issues, I've observed and found all thumbnail links are use redirected links, this change also affect cosmetic filtering that block gelbooru.com/redirect.php hyperlinks because they place redirect.php links only at advert links in the past, didn't expect their also apply on image list thumbnails.

The inline-script only triggered when they cannot found any value for abvertDar and then show disable adblock notice message, also re-show ads at footer.

uBlock-user commented 7 years ago

Just add - a.noAccess("abvertDar"); that kills anti adblock script entirely.

Aurani commented 7 years ago

I can view the images fine now, but the script to edit tags is now broken despite my custom rules that previously enabled it. @@http://$script,domain=gelbooru.com @@https://$script,domain=gelbooru.com

jspenguin2017 commented 7 years ago

@okiehsch A lot of site functionalities are now broken, the warning box is gone, but comments are no longer working. This filter is bad: image

lain566 commented 7 years ago

@jspenguin2017 ublock _ _registro_de_peticiones_de_red_-_google_c_2017-05-08_12-59-07

jspenguin2017 commented 7 years ago

@lain566 Oh, that might be a filter from AAK List, lemme check

Script 6.199 will take care of the home page.

jspenguin2017 commented 7 years ago

OK, I see why inline script is blocked... But we need to fix those href="javascript:..." and "onclick="...".

uBlock-user commented 7 years ago

The solution I provided in https://github.com/jspenguin2017/AdBlockProtector/issues/182#issuecomment-299854766 doesn't break anything and kills the anti adblock script.

jspenguin2017 commented 7 years ago

@uBlock-user Yes, but then it serves you first party ads.

lain566 commented 7 years ago

This is breaking the site

ublock _ _registro_de_peticiones_de_red_-_google_c_2017-05-08_12-40-29

uBlock-user commented 7 years ago

@jspenguin2017 Where ? I don't see any.

jspenguin2017 commented 7 years ago

@uBlock-user Did you $badfilter the inline script blocking rule?

uBlock-user commented 7 years ago

No, I rather disabled uBlock Filters as I was running the test.

kowith337 commented 7 years ago

Can I still prove my test? I've using my custom filterlist that targeted to this site so far and didn't get any issues until today because they start to replace thumbnail links to use redirect links instead of go to the post directly.

PS. I didn't have any accounts on Gelbooru to test between different of usage or function while still not lower the guard (uBlock, uMatrix, etc.) At my side after fixed hiding hyperlink, the site still run fine and still block ads, even not have userscript installed.

jspenguin2017 commented 7 years ago

@uBlock-user With uBO filter disabled, this is what I see:

NSFW ![image](https://cloud.githubusercontent.com/assets/7283682/25811439/8c4eaa92-33d0-11e7-8c7e-c75175bdd414.png)
uBlock-user commented 7 years ago

Does blocking inline-script break anything ?

jspenguin2017 commented 7 years ago

@kowith337 You were blocking redirect.php, but that is not in EasyList nor any other filters. The site currently works at 80% with uBO filter, some "minor" functionalities like comments are broken. Looks like the event handler was not binded.

image

@uBlock-user Yes, comments mainly.

jspenguin2017 commented 7 years ago

To solve constant disagreements in our tests, we now have Standard Setup. Also, because of constant breakage with FireFox, we'll, once again, drop the support for FireFox.

uBlock-user commented 7 years ago

Fine, make the call. I'm okay with comment section breaking as I'm not a commentator and can't spend time on this further just for comment section, so I'm leaving this one to you.

jspenguin2017 commented 7 years ago

@uBlock-user I rarely leave comments neither, but we can't call this fixed just because we don't use things that breaks.

uBlock-user commented 7 years ago

Ofcourse we can't call it fixed "technically", however I'm choosing lesser of two evils as I don't want another 200+ comments added to the issue tracker just in the name of discussion, neither I have the patience to do that again.

okiehsch commented 7 years ago

@okiehsch A lot of site functionalities are now broken, the warning box is gone, but comments are no longer working.

@jspenguin2017 "ajax.googleapis.com is blocked by EasyList, the comments would still be broken without inline-script." https://github.com/uBlockOrigin/uAssets/commit/293a4c2b410d9525db3f17a23f53db8c64249f7b#commitcomment-22061018

jspenguin2017 commented 7 years ago

@okiehsch So we will wait for EasyList to fix that? Also, some of these options on the side bar are not really working: image I'm thinking of extracting those event handlers and bind them using Script.

okiehsch commented 7 years ago

So we will wait for EasyList to fix that?

gorhill added the inline-script block not me, so you really should ask him. You can do that here: https://github.com/uBlockOrigin/uAssets/commit/293a4c2b410d9525db3f17a23f53db8c64249f7b#comments

jspenguin2017 commented 7 years ago

@okiehsch Dump of result page: https://pastebin.com/wQkPE5Dn Dump of image page: https://pastebin.com/9UkUaJ0z

So this is my new plan:

jspenguin2017 commented 7 years ago

@okiehsch Let's just fix it.

if (a.domCmp(["gelbooru.com"])) {
    if (a.win.location.pathname === "/") {
        a.on("load", function () {
            a.$("div").each(function () {
                if (a.$(this).text() === "Have you first tried disabling your AdBlock?") {
                    a.$(this).empty();
                } else {
                    a.config.debugMode && a.out.log(a.$(this).text());
                }
            });
        });
    } else {
        a.noAccess("abvertDar");
    }
}
||gelbooru.com^$inline-script,badfilter
@@||ajax.googleapis.com/ajax/libs/jquery/*$script,domain=gelbooru.com
jspenguin2017 commented 7 years ago

OK, everything works on my end now 😄

lain566 commented 7 years ago

@jspenguin2017 can you delete this rule https://cloud.githubusercontent.com/assets/27441315/25809123/64c6fe66-340c-11e7-9a93-377884777947.png

gelbooru.com##.noticeError

image_list__gelbooru_-_google_chrome_2017-05-08_23-47-34

jspenguin2017 commented 7 years ago

@lain566 Thanks. That is done.

lain566 commented 7 years ago

@jspenguin2017 is now better, but...

'Click here' not working?? :disappointed: https://gelbooru.com/index.php?page=post&s=view&id=3680957 absurdres_breasts_dandon_fuga_eyebrows_green_eyes__2017-05-09_00-39-00

jspenguin2017 commented 7 years ago

image OK, there are some other conflicting filters...

jspenguin2017 commented 7 years ago

Eh... image

jspenguin2017 commented 7 years ago

What's the rule that disables all other element hiding rules? $badfilter somehow doesn't work. @@||gelbooru.com^$elemhide doesn't work... gelbooru.com#@##image doesn't work neither...

This works, but I don't want to use it...

a.ready(function () {
    a.$("style:contains(:root)").remove();
});
okiehsch commented 7 years ago
gelbooru.com#@#[style*="height:"][width]
gelbooru.com#@#[style*="width:"][height]

should work. I don't think there is a rule that disables all cosmetic filtering. You can toggle off cosmetic filtering on a per site basis, or disable it globally, that will also fix this issue.

lain566 commented 7 years ago

Paginator and Add Reply is blocked by EasyList

https://gelbooru.com/index.php?page=forum&s=view&id=3437

02

gelbooru.com###paginator
gelbooru.com##center > a[href]

ublock _ _registro_de_peticiones_de_red_-_google_c_2017-05-08_12-41-26 ublock _ _registro_de_peticiones_de_red_-_google_c_2017-05-08_12-36-13

jspenguin2017 commented 7 years ago

Here are all the rules in EasyList that is specific for this domain:

||gelbooru.com*/frontend*.js
||gelbooru.com/lk.php$subdocument
||gelbooru.com/poll.php$subdocument
||gelbooru.com/protech.php$subdocument
||gelbooru.com/x/

||twitch.tv/widgets/live_embed_player.swf$domain=gelbooru.com

@@||gelbooru.com/index.php?$xmlhttprequest
@@||gelbooru.com/public/$xmlhttprequest,domain=gelbooru.com
@@||gelbooru.com/script/application.js$script
@@||platform.twitter.com^$script,domain=gelbooru.com
|http://$script,xmlhttprequest,domain=gelbooru.com
|https://$script,xmlhttprequest,domain=gelbooru.com

||thedoujin.com^$domain=gelbooru.com

gelbooru.com##[-abp-properties='*: *;base64,']

gelbooru.com##[src^="http://syndication.exoclick.com/"] + * + * + [class]

gelbooru.com##center > a[href]

gelbooru.com###paginator
gelbooru.com##[height="250"]
gelbooru.com##[href*="ccbill."]
gelbooru.com##[href][rel*="nofollow"] video
gelbooru.com##[href][target*="blank"] video
gelbooru.com##[rel*="nofollow"] > [style]
gelbooru.com##[style*="height:"][width]
gelbooru.com##[style*="height:250px;"]
gelbooru.com##[style*="width:"][height]
gelbooru.com##a > [style][autoplay]
gelbooru.com##a[href*="/clicks.cgi"]
gelbooru.com##a[href*="?"][rel] > video
gelbooru.com##a[href] > :last-child > img[src]
gelbooru.com##a[id][href][rel*="nofollow"]
gelbooru.com##center > div > style + div[class]
gelbooru.com##center > div[style*="overflow:"]
gelbooru.com##div > [rel] > video[width]
gelbooru.com##div > div[id] > [href] > img[src]
gelbooru.com##div[style] > [class][style]
gelbooru.com##iframe + style + [class]
gelbooru.com##iframe[width]
gelbooru.com##span > style[type="text/css"] + *
gelbooru.com##span[class]:last-child > a img[src]

@@||ads.exoclick.com/*.js$script,domain=gelbooru.com|thepiratebay.org

@@||gelbooru.com//images/ad/$domain=gelbooru.com
jspenguin2017 commented 7 years ago

So excluding rules that are already added to List, we need these?

gelbooru.com#@#[style*="height:"][width]
gelbooru.com#@#[style*="width:"][height]
gelbooru.com#@##paginator
gelbooru.com#@#center > a[href]
lain566 commented 7 years ago

@jspenguin2017 Yes, that works!

jspenguin2017 commented 7 years ago

Looks like they just got some new first party ads, the last rule seems to able to block them without breaking anything else, I added these to List, can someone test it out?

gelbooru.com#@#[style*="height:"][width]
gelbooru.com#@#[style*="width:"][height]
gelbooru.com#@##paginator
gelbooru.com#@#center > a[href]
||assets.gelbooru.com/r19/

Also, for convenience, here are the test links scattered across this issue: Search page: https://gelbooru.com/index.php?page=post&s=list&tags=breasts Image page: https://gelbooru.com/index.php?page=post&s=view&id=3680957 Forum page: https://gelbooru.com/index.php?page=forum&s=view&id=3437

![image](https://cloud.githubusercontent.com/assets/7283682/25982133/fccb1cce-3696-11e7-9ce3-fdfbfc931dbd.png)
lain566 commented 7 years ago

Everything works fine, but add this too

it's changing /r18/ /r19/... ||assets.gelbooru.com/r18/

block popups ||gelbooru.com/script/application.js.php$important

Doujin (thedoujin.com), the friend site, this site has many ads ||thedoujin.com/bload.php

jspenguin2017 commented 7 years ago

@lain566 Thanks, I'll test it out.

jspenguin2017 commented 7 years ago

@lain566 Looks good, added to List.

lain566 commented 7 years ago

@jspenguin2017 thanks

jspenguin2017 commented 7 years ago

Looks like everything is still working. Closing. Please open another issue if it breaks again as this thread is pretty long.