DandelionSprout / adfilt

The place where I, DandelionSprout, store my web filter lists for countless topics, including my Nordic adblock list. As simple as that, really.
Other
1.3k stars 143 forks source link

Submission for browse websites without logging in #772

Closed jschenke488 closed 7 months ago

jschenke488 commented 1 year ago

On Hackster.io, there is a signup modal that appears which also prevents scrolling. There's probably a better way to write the first filter, but it works for me. Tested with uBlock Origin on LibreWolf.

! Annoying sign up popup on Hackster.io
hackster.io##body > div > div > div > div > div > div > div:has-text(/join the world/i):xpath(../../../../../..)
hackster.io##body:remove-class(no-scroll)
DandelionSprout commented 1 year ago

The annoying popup seems to be Firefox-engine-exclusive indeed, and I'm unsure to which extent AdGuard has implemented uBO's :remove-class yet, so I landed on these two:

hackster.io#?#div[data-hacksternova-key=AuthDialog]:has-text(Join the world)
hackster.io##body.no-scroll:style(overflow: unset !important)

I'll add them after I've had some dinner.

Nojuuu commented 1 year ago

If you try to press signup button in the navbar it doesn't work with those.

DandelionSprout commented 1 year ago

Hmm, good point. I had only tested with the "Log in" button in the upper right, and not the "Sign up" button. I'll get back to this matter in some hours' time.

Nojuuu commented 1 year ago

I couldn't come up with any scriptlets that wouldn't break it.

Nojuuu commented 1 year ago

Unless it is somehow possible to remove click event listener only from specific element, then you could make it to go https://www.hackster.io/users/sign_up instead of opening the modal.

DandelionSprout commented 1 year ago

Although I was able to identify the specific script that causes that prompt on each page load, blocking it also prevents all sections on the homepage below the "Topics" one to fail to load. So I'm stumped.

Nojuuu commented 1 year ago
! Hide and change background opacity
hackster.io##[data-hacksternova-key="AuthDialog"] [data-nested-dialog]:style(visibility: collapse; background-color: rgba(0, 0, 0, 0.4) !important)

! If log in/sign up button was clicked, change the opacity back to what it was and make the modal visible again
hackster.io#?#body:has([action="SigninDialog"]:focus) [data-hacksternova-key="AuthDialog"] [data-nested-dialog]:style(background-color:rgba(0, 0, 0, 0.5) !important)
hackster.io##[data-hacksternova-key="AuthDialog"] [data-nested-dialog]:matches-css(background-color: rgba(0, 0, 0, 0.5)):style(visibility: visible !important;)

! Fix scrolling
hackster.io##body:style(overflow: auto !important;)

Does this work?

jschenke488 commented 1 year ago

Found a filter that doesn't block the popup when it's from the signup button. From my testing, when sign up is actually clicked, #g-recaptcha-response is instead #g-recaptcha-response-x where x is an integer.

! Annoying sign up popup on Hackster.io
hackster.io##body.no-scroll:style(overflow: unset !important)
hackster.io#?#div[data-hacksternova-key=AuthDialog]:has-text(Join the world):has(#g-recaptcha-response)

Edit: may have problems with reliability, needs further testing

jschenke488 commented 1 year ago

I'm unsure to which extent AdGuard has implemented uBO's :remove-class yet

https://github.com/AdguardTeam/ExtendedCss/issues/153

DandelionSprout commented 7 months ago

It seems that no consensus was reached on a permanently functioning fix after 8 months, so I figure I can just as well close this by now, unfortunately.

Nojuuu commented 7 months ago

I can't even reproduce it, maybe they changed it?