How to disable right click for a Myspace page?

Suppress right-click menu on a web site

  • Is there a way to disable the right-click menu on a particular web page I visit that isn't managed by me? I play a solitaire game on a particular web site fairly often. It's not a Flash game, nor is it a Java applet, I suspect it's simply JavaScript. The game allows you to use both left and right clicks, each performing different actions, but every time you right-click the normal browser right-click menu appears...very annoying in this context. Is there a way for me to tell my browser I don't want the right-click menu to appear on this one particular page (or its domain, if that's easier)? I have greasemonkey installed, so a GM script would be ideal, but I haven't been able to locate one. I'm on Windows, using FF. Thanks mucho for any ideas. (I could possibly write my own script if pointed in the right direction.)

  • Answer:

    For Greasemonkey if(document.addEventListener) document.addEventListener('contextmenu', function(e) { e.stopPropagation(); }, false); else if(document.attachEvent) document.attachEvent('oncontextmenu', function() { event.cancelBubble = true; }); Set up a new user script and apply it to the appropriate domain, then copy and paste the above in.

maxwelton at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

An easy way for you to do it would be to make a toolbar bookmark with javascript:void(document.oncontextmenu=new%20Function("return%20false"))in it. When you click on it up in your toolbar right clicking should be disabled for the page. Took me way longer to figure that out than it should have; I am apparently way too rusty with these things.

Stunt

Thanks! I was able to get Sparx solution to work a treat, but I could not get Stunt's to work, which may be more me than their solution.

maxwelton

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.