Skip to content
Advertisement

How can i override a jquery function on chrome browser?

I have this website where i take notes from. Currently i have to manually type all my notes. They have disabled the right context menu. I have added a chrome extension that can run javascript on the page, but i am not able to override their function that overrides the context menu. Here is what they have on the page.

JavaScript

How can i disable it using some simple javascript. I have tried to override the context menu and set it to null, but it does not seem to be working

Advertisement

Answer

You can use jQuery off() and a new function for document.oncontextmenu that returns true instead of false

I’ve wrapped these in a button click handler just to show the original code blocking the context menu and keyboard copy and being reset when you click on the button

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement