webgadget disable contextmenu the easy way :)

Share your advanced PureBasic knowledge/code with the community.
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

webgadget disable contextmenu the easy way :)

Post by utopiomania »

If you use the webGadget and want to disable the right click context menu you can either use
a callbak(=urk..), or simply add oncontexmenu.. to your html body tags:

Code: Select all

"<body oncontextmenu = 'return false;'>"
This method work very well if you can use it (= you have control over the html loaded
into the webgadget), the principle beeing Keep It Simple Stupid :)
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

Should only work with IE 6 or higher.

Maybe, this works with Mozialla as well, my knowlege is several years old now...
PB 4.30

Code: Select all

onErrorGoto(?Fred)
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Post by utopiomania »

Ok? IE's before 6 can't run javascript then, is that what you try to say? Or is my syntax wrong, or what? :?
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

In my opinion, 'onContextmenu' is a JavaScript eventhandler, that is only supported in IE 5.x or 6.0 (and higher).

But my knowlege is not up to date, so maybe this eventhandler is now suppoerted by other browsers, too. Last time I coded JavaScript was about 2 years ago.

@ Mozilla/FireFox: I recognized, that this browser interprets JavaScript almost identically with IE, so maybe this is the onliest other browser, supporting this eventhandler.
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

I used this in the other programming platform I use that "borrows" I.E. and it works great!

Thanks for sharing.
Intrigued - Registered PureBasic, lifetime updates user
Post Reply