Exploring the concept of blocking the context menu using JavaScript.
Here's how you can block such a menu:
document.addEventListener('contextmenu', event => event.preventDefault());
I recently came across an article that mentioned this blocking being reversible by typing the following into the address bar:
javascript:void(document.oncontextmenu=null);
I decided to test this in Chrome on Windows. However, pasting it directly didn't work as expected and instead triggered a search query on Google. Instead, creating a bookmark with the code and applying it on the target page did unblock the context menu successfully.
This raises two questions: 1. What sets apart manually inputting the script in the address bar versus using a bookmark? 2. Is there another way to execute this script without a bookmark? Does it vary depending on the browser or other factors?