4 ms·
Can an extension like tampermonkey block/highjack events from a page?
by hackersword 8y ago
Can an extension like tampermonkey block/highjack events from a page?
- sli 8y agoYes. jQuery's `.unbind()` can do it easily, but doing it in vanilla JS is a bit different[1]. You essentially clone the node and swap the clone into the original node's spot. This also clears all event handlers for any child nodes (so, swap out <body> with a clone and you're set). [1]: https://stackoverflow.com/a/19470348/13876 https://stackoverflow.com/a/19470348/13876