-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] better aeld event defuser #3491
Comments
Try in Firefox: foo.bar##[onXxxxx*="foo"]:remove-attr(onXxxxx) Try in Chromium (and hard cases only for Firefox): foo.bar##+js(ra, onXxxxx, [onXxxxx*="foo"], asap stay) |
Provide actual real world cases please, I prefer to not spend time on code which has no real world use case -- that is why we ask for "specific URL where the issue occurs". |
To me, the only thing that comes to mind is masking events with e.g. jQuery, but that's something even AdGuard developers don't want to touch. AdguardTeam/Scriptlets#362 (comment) In addition, for uBO perhaps a selector (gorhill/uBlock@060f9d6) will also help for such accidents:
Unfortunately, that request there is also a PoC and not a real threat, where we need to find another method to neutralize the problem. |
hi, @krystian3w @gorhill a sample url of my specific issue is https://www.foxteller.com/novel/643/1/the-witch-and-the-mercenary/001 i didn't provide the specifics since i didn't want to turn this into a support request, just a generally useful feature request. the approach with capture phase stopImmediatePropagation works rather well from my experience - i actually have a userscript for it for the contextmenu event. i would have solved the copy/cut with a userscript as well if it bothered me too much, but uBO was more convenient for a few other annoyances on the site - css for unstickying the header and allowing user selection, disabling console.log since they spam it, defusing selectionchange event which works fine, etc., so i thought i'd try to tack on the copy/cut things to that too. |
Which browser are you using? |
edge |
foxteller.com##+js(ra, oncontextmenu|oncopy|oncut, [id^="chapter"], stay)
That's why please always provide all information in the template, even for Feature request. Different browsers can have different behaviors. |
indeed, that solved the issue, thanks. i didn't try it since the docs were suggesting the newer approach. |
Prerequisites
I tried to reproduce the issue when...
Description
currently, the
aeld
scriptlet does not stop events set withonxxxx
attribute/propertycan we please get another version or a flag which instead of monkey-patching addEventListener just sets a capture phase event handler on the window which calls stopImmediatePropagation to block all other handlers no matter how they are set?
if it is the first such handler that is set it is guaranteed to be the first executed too, so seems like a more reliable approach, except for the few rare events that don't bubble.
A specific URL where the issue occurs.
Steps to Reproduce
Expected behavior
Actual behavior
uBO version
Browser name and version
Operating System and version
The text was updated successfully, but these errors were encountered: