Last active
September 5, 2023 09:46
-
-
Save hidao80/2baeb927a8e746ac0ba7a8578f798f12 to your computer and use it in GitHub Desktop.
Bookmarklet to enable context menus on web pages that do not allow right-clicking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(()%3D%3E%7B!function()%7Bfor(const%20o%20of%5Bdocument%2Cdocument.body%5D)o.addEventListener(%22contextmenu%22%2C(o%3D%3E%7Bo.stopImmediatePropagation()%7D)%2C!0)%7D()%3B%7D)() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
for (const elem of [document, document.body]) { | |
elem.addEventListener('contextmenu', e => { | |
e.stopImmediatePropagation(); | |
}, true); | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment