Learn How to enable right click on a Website !
Hey Guys, I am Vishesh Khatri from MyReviewBites.com. In this post I will teach you guys how to enable right click on the website where doing a right click is blocked as seen in proctored exams , government, educational or other such websites without help of any extension.
You would be thinking that “Why do such website owner’s disable right click on their websites? ” !
Here are the reasons why these website owner’s disable right click on their websites.
- To prevent users from copying and pasting content or images from the website.
- To prevent users from accessing certain features or functions of the website which they don’t want them to use.
- To display menus or options when the right-click function is used.
- As a security measure to prevent unauthorized access or modifications to the website’s code or content.
- To protect copyright or intellectual property rights.
- To prevent users from inspecting or viewing the website’s source code.
- To improve the user experience by disabling the right-click menu that may interfere with the website’s design.
- To prevent accidental right-clicks that may cause unexpected actions or errors.
Note: Some of these reason’s are really genuine and one should not harm anyone’s website so use this trick with a good intention and learning purpose only.
How to enable right click on a website without any extension !
Step 1. Open the website where you are not able to press right click or copy content from that site.
Step 2. Open the console as per the browser you are using the steps to open the console may vary so I am listing all famous browser’s steps below open the console in your browser.
- Google Chrome: Right-click on the webpage and select “Inspect” from the context menu, or press “Ctrl + Shift + I” (Windows/Linux) or “Cmd + Opt + I” (Mac). Then, click on the “Console” tab in the Developer Tools panel.
- Mozilla Firefox: Right-click on the webpage and select “Inspect Element” from the context menu, or press “Ctrl + Shift + I” (Windows/Linux) or “Cmd + Opt + I” (Mac). Then, click on the “Console” tab in the Developer Tools panel.
- Safari: Go to “Preferences” > “Advanced” and select the “Show Develop menu in menu bar” option. Then, click on “Develop” in the menu bar and select “Show Error Console,” or press “Opt + Cmd + C”.
- Microsoft Edge: Right-click on the webpage and select “Inspect” from the context menu, or press “F12”. Then, click on the “Console” tab in the Developer Tools panel.
- Internet Explorer: Press “F12” or go to “Tools” > “Developer Tools” and select the “Console” tab.
Step 3. Copy and Paste this Java Script code in the console and press Enter .
javascript:function enableContextMenu(aggressive = true) { void(document.ondragstart=null); void(document.onselectstart=null); void(document.onclick=null); void(document.onmousedown=null); void(document.onmouseup=null); void(document.body.oncontextmenu=null); enableRightClickLight(document); if (aggressive) { enableRightClick(document); removeContextMenuOnAll('body'); removeContextMenuOnAll('img'); removeContextMenuOnAll('td'); } } function removeContextMenuOnAll(tagName) { var elements = document.getElementsByTagName(tagName); for (var i = 0; i < elements.length; i++) { enableRightClick(elements[i]); enablePointerEvents(elements[i]); } } function enableRightClickLight(el) { el || (el = document); el.addEventListener('contextmenu', bringBackDefault, true); } function enableRightClick(el) { el || (el = document); el.addEventListener('contextmenu', bringBackDefault, true); el.addEventListener('dragstart', bringBackDefault, true); el.addEventListener('selectstart', bringBackDefault, true); el.addEventListener('click', bringBackDefault, true); el.addEventListener('mousedown', bringBackDefault, true); el.addEventListener('mouseup', bringBackDefault, true); } function restoreRightClick(el) { el || (el = document); el.removeEventListener('contextmenu', bringBackDefault, true); el.removeEventListener('dragstart', bringBackDefault, true); el.removeEventListener('selectstart', bringBackDefault, true); el.removeEventListener('click', bringBackDefault, true); el.removeEventListener('mousedown', bringBackDefault, true); el.removeEventListener('mouseup', bringBackDefault, true); } function bringBackDefault(event) { event.returnValue = true; (typeof event.stopPropagation === 'function') && event.stopPropagation(); (typeof event.cancelBubble === 'function') && event.cancelBubble(); } function enablePointerEvents(el) { if (!el) return; el.style.pointerEvents='auto'; el.style.webkitTouchCallout='default'; el.style.webkitUserSelect='auto'; el.style.MozUserSelect='auto'; el.style.msUserSelect='auto'; el.style.userSelect='auto'; enablePointerEvents(el.parentElement); } enableContextMenu();
Now all your limitations would end and you would be able to right click and use the website without any restriction on right click
Hope your problem would have been solved after trying it out in real.
If you face any problem or have any doubt you can join our telegram group and ask it there or you can comment below.
Join our Telegram Group
https://t.me/Myreviewbites
Also
Join our Telegram Channel
https://t.me/+S7XvPEucBG1siP1E
1 Comment
Pingback: Convert Old Tablet To Additional Screen Using Spacedesk Free