ccd0 / 4chan-x

Adds various features to anonymous imageboards.
https://www.4chan-x.net/
Other
984 stars 135 forks source link

workaround for 4chan css being rekt due to hiroshmoot fuckery #1734

Closed fuaxio closed 6 years ago

Supertatortots commented 6 years ago

Is this the issue where everything suddenly turns white? I've noticed that it happens when you scroll all the way to the bottom.

ghost commented 6 years ago

Dammit, hope this gets fixed soon. 4chan x is not usable atm

ghost commented 6 years ago

What did that jap fuck do now? It's unusable atm.

ccd0 commented 6 years ago

I've heard about it but I haven't seen it myself yet. What's your configuration?

ghost commented 6 years ago

The problem is when you scroll to the very bottom of the page, everything will turn white and the css gets removed

ccd0 commented 6 years ago

Yeah, as I said, I don't see it on my end, at least not yet. What's your browser and userscript manager and ad blocker and versions of all of that?

ghost commented 6 years ago

Browser: Google Chrome Version 63.0.3239.84 (Official Build) (64-bit) Adblocker: uBlock Origin 1.14.20

ghost commented 6 years ago

Browser: Chrome Version 63.0.3239.84 (Official build) (64-bits) Adblock: uBlock Origin 1.14.20 Userscript manager: Tampermonkey 4.4 Also using StyleChan 1.0.14 + Extra flags for int 0.30

ccd0 commented 6 years ago

I've got it reproduced on Chromium. Does this fix it for you? It worked for me, but might not be reliable especially with Tampermonkey (haven't tested with that yet). https://boards.4chan.org/g/thread/63894609#p63896479

If you use 4chan X, go settings->advanced->javascript whitelist and put a # in front of 'unsafe-eval'. It seems like that fixes it for now.

ghost commented 6 years ago

It does but it also disables all other scripts I've got running. At least it's a temporary solution.

Supertatortots commented 6 years ago

Browser: Vivaldi 1.13.1008.36 (Stable channel) (64-bit) Adblock: uBlock Origin 1.14.20

Interesting note, 4chan X is working fine on /qa/. This probably has to do with some new ads or whatever that's being run.

And also the temp solution does work on my end.

ghost commented 6 years ago

Yeah, 4chan X is working on /toy/ but not on /a/ for me

fuaxio commented 6 years ago
  1. Install uBlock Origin https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/
  2. Install a userscript manager https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
  3. Open uBlock's options, go to "My filters" tab and paste this: https://pastebin.com/raw/4Jm6G4gJ
  4. Open Tampermonkey/Greasemonkey, add a script and paste this: https://pastebin.com/raw/28Lcd7KR

This makes the captcha not work. but otherwise works.

SpatulaTzar commented 6 years ago

Thanks for the fix @fuaxio it seems to fix the issues. I have a pass so captcha isn't an issue for me.

Edit: Should mention I'm using Iridium with Tampermonkey and have uBlock Origin. I am also running a few scripts 4chanX, oneechan, Xlinks, and the Anti-Adblock killer.

fskaeh commented 6 years ago

Thanks @fuaxio that did the trick

DumbIdiot commented 6 years ago

@fuaxio Fix works, but it breaks the catalog and the reply form at the top is not hidden anymore.

Chrome Userscript version Tampermonkey

ghost commented 6 years ago

@fuaxio Would use this but if it breaks the captcha it's kinda pointless for me. Thanks anyway.

fskaeh commented 6 years ago

@DumbIdiot @timwelter09 Not getting any issue with captcha nor catalog here.

ccd0 commented 6 years ago

Removing the HTML element where the ad is supposed to go seems to be enough to stop this behavior. I've put that out as a temporary fix. Ideally we'd like to prevent the script from running, but it may be difficult to do that without breaking other things.

DumbIdiot commented 6 years ago

@ecrvnr It's the 4chan catalog that breaks. The 4chan X Catalog works.

DumbIdiot commented 6 years ago

The pastebin userscript has been updated and fixed the native catalog, but anon says the original reply form at the top of pages being unhidden cannot be fixed as it's an issue with 4chan x.

bakugo commented 6 years ago

It's possible to work around this new anti-adblock method completely in a cross-browser way by blocking all inline scripts (via uBlock or directly with CSP unsafe-inline) and manually evaling the ones the site still needs (like the ones that define style_group and recaptchaKey). An example implementation is here.

Unfortunately this does not play nice with 4chan X since it uses inline scripts in the $.globalEval function. It still mostly works, but some things are broken, such as the lack of the js-enabled class in the document root which causes the original post form to always display. It also causes the noscript version of the captcha to always be used.

Of course, there's also the issue of this being extremely easy to bypass if Hiro wants to. In my opinion 4chan X should just drop all site HTML and generate its own at this point but I understand if that's too much work.

Dragas commented 6 years ago

@bakugo It's really not. The API is public and all you would need to do is write a couple of templates. 4chanx already links each post which it would quote. Pop it through your favorite front end framework and BAM. You've got your 4chan webapp. The only problem would be keeping up with any "new" features that 4chan would throw out. Currently as a solution to these sort of shenanigans I am proposing Chandler.

Khris777 commented 6 years ago

I have been using @fuaxio's fix for a while with Waterfox and it worked fine until yesterday, now the css looks as broken as before,

4chan-X still seems to be working, I can use Quick Reply and the Gallery, the latter is having some lag issues in longer threads though.

EDIT: Solved all problems by putting uBlock Origin into advanced mode and allowing Inline Scripts. No further need for the extra script in Greasemonkey.

ccd0 commented 6 years ago

See also #1885