General JavaScript injection with uBO #34
MasterInQuestion
started this conversation in
uBlock Origin
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hacky way of general JavaScript injection with uBlock Origin. (as of 1.60)
Should portably work for all pages have at least 1 inline "<script>" ("<script>" without "src").
E.g.
127.0.0.1##+js( rpnt, script, /$/, "; if ( typeof __Trigger === 'undefined' ) { __Trigger = 1; document.addEventListener( 'DOMContentLoaded', function () { alert( '\"Master\'s OK!\"' ); } ); };" )
.
Actual utilization: https://github.com/MasterInQuestion/talk/discussions/13#discussioncomment-10428094
The other is using "replace". (Firefox only)
E.g. https://github.com/orgs/community/discussions/5972#discussioncomment-7809031
One more potential way is using "trusted-set-constant" on "onload" alike.
But currently uBO seems to have bug with it:
Values limit still caught the trusted variant: effectively turning which into "set-constant" untrusted.
E.g. compare:
127.0.0.1##+js( trusted-set-constant, onload, "32767" )
127.0.0.1##+js( trusted-set-constant, onload, "32768" )
Beta Was this translation helpful? Give feedback.
All reactions