Google Groups Home
Help | Sign in
Detect if browser r-click context menu can be over-ridden
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Giles  
View profile
 More options Jul 21, 9:03 am
Newsgroups: microsoft.public.scripting.jscript
From: "Giles" <gi...@nospam.com>
Date: Mon, 21 Jul 2008 14:03:47 +0100
Local: Mon, Jul 21 2008 9:03 am
Subject: Detect if browser r-click context menu can be over-ridden
JS allows (right-click) custom context menus using
document.oncontextmenu=ShowMyContextMenu; . Some browsers (e.g. opera) don't
allow custom context menus, but do not throw an error if they are called -
it's just ignored.
Is there a way in script to test if a custom context menu is allowed (so if
not, an alternative can be offered, like a button with a drop-down list)?
Thanks, Giles

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Old Pedant  
View profile
 More options Jul 22, 1:15 pm
Newsgroups: microsoft.public.scripting.jscript
From: Old Pedant <OldPed...@discussions.microsoft.com>
Date: Tue, 22 Jul 2008 10:15:25 -0700
Local: Tues, Jul 22 2008 1:15 pm
Subject: RE: Detect if browser r-click context menu can be over-ridden
Couldn't you just set some page-scope JS variable during the setup of the
context menu and, if your other code doesn't detect that it was initialized,
do something else??

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Giles  
View profile
 More options Jul 23, 8:31 am
Newsgroups: microsoft.public.scripting.jscript
From: "Giles" <gi...@nospam.com>
Date: Wed, 23 Jul 2008 13:31:26 +0100
Local: Wed, Jul 23 2008 8:31 am
Subject: Re: Detect if browser r-click context menu can be over-ridden
"Old Pedant" wrote

> Couldn't you just set some page-scope JS variable during the setup of the
> context menu and, if your other code doesn't detect that it was
> initialized,
> do something else??

I've since found that a (physical) right click in Opera does not send any
kind of message whatsoever that can be seen by JS. There is no way of
detecting when the user actually does a right-click (although simulating
right clicks is possible in code). So no point testing if a variable has
been initialised because you don't know if the user has even tried a right
click. Just because simulating it will initialise the variable doesn't mean
anything. I've given up on this, I don't think it is possible.

I have no objection to this behaviour for web pages, as one wants interface
consistency between web sites, and it is very annoying when the right click
is "stolen", but for creating stand-alone web applications rather than pages
it is a pain. The browsers should at least make it detectable whether custom
context menus are possible...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google