Suppressing the right click context menu via JavaScript fails! preventDefault()

Forums » General Opera topics » Opera and cross-browser Web design

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

24. February 2009, 23:14:46

admiralquade

Posts: 14

Suppressing the right click context menu via JavaScript fails! preventDefault()

Hi,

Opera is the ONLY Browser that fails to suppress the right click context menu via the preventDefault function.

I am currently building a JS right click context menu, which works fine... even with the IE 6. But I can't figure out how to disable the default context menu of Opera. Is there a workaround? You can see the running code at http://testground.finnrudolph.de/js/right_click_menu/

And this is the function that works just fine with Chrome, Firefox, IE and Safari:

/* Mouse button detection */
	this.MouseButton =
	{
		/* Init mouse button event listener */
		init: function()
		{
			thisObject.addEvent(document,'mousedown',thisObject.MouseButton.get);
			thisObject.addEvent(document,'mouseup',thisObject.MouseButton.suppressBrowserMenu);
			thisObject.addEvent(document,'click',thisObject.MouseButton.suppressBrowserMenu);
			thisObject.addEvent(document,'dblclick',thisObject.MouseButton.suppressBrowserMenu);
			thisObject.addEvent(document,'contextmenu',thisObject.MouseButton.suppressBrowserMenu);
		},

		/* Get the current mouse button */
		get: function(e)
		{
			var button;
			if (e.which == null)
			{
				button = (e.button < 2) ? "LEFT" : ((e.button == 4) ? "MIDDLE" : "RIGHT");
			}
			else
			{
				button = (e.which < 2) ? "LEFT" : ((e.which == 2) ? "MIDDLE" : "RIGHT");
			}
			thisObject.MouseMenu.init(e,button);
			thisObject.MouseButton.suppressBrowserMenu(e);
		},

		/* Suppress the default browser menu on right click */
		suppressBrowserMenu: function(e)
		{
			if (e.preventDefault)
			{
				e.preventDefault();
			}
			else
			{
				e.returnValue = false;
			}
			return false;
		}
	};

25. February 2009, 02:36:29

splondike

Posts: 528

The accepted method is to do something like ctrl+click for the JS menu. That way opera users get to keep their right click menu, but also interact fully with your application.

25. February 2009, 08:33:21

admiralquade

Posts: 14

That is exactly NOT what I want. Sounds like something for the poor mac users with only one mousbutton trying to access an context menu ;D

I don't want to suppress Operas context menu globally within the document, but only for some areas. Think a list, where one can edit the items via the context menu.

Is there an Opera developer around in this forum? Is there a workaround? anyone?

25. February 2009, 13:12:13

Phasdasdasd87

Banned user

"itsafeature" +1
wink

25. February 2009, 22:44:31

Frenzie

Posts: 14478

Ctrl+click is the default for saving an image, perhaps shift+click or something would be a better alternative?

Personally I hate whoever first came up with suppressing the normal right click menu (I'm thinking IE, but might be Netscape), but I suppose it might be a good idea for Opera to adapt due to all the other browsers.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

26. February 2009, 08:48:11 (edited)

admiralquade

Posts: 14

@ Frenzie: As I stated above: It is all about developing real webbased services and that includes total control over the interface...

Back to the topic: No ideas how to force Opera to suppress the right click context menu with JavaScript? Is it impossible with the latest version? Will it be possible in the next release?

UPDATE: Just tried Opera 10 alpha (http://www.opera.com/browser/next/) same problem, no changes....

26. February 2009, 10:21:06 (edited)

admiralquade

Posts: 14

YAY! I got it... but it still is a dirty workaround:

If you leave the window and reopen it the context menu is gone. This can be done via JavaScript *hooray*:

/* Suppress the default browser menu on right click */
		suppressBrowserMenu: function(e)
		{
			if (e.preventDefault)
			{
				e.preventDefault();
			}
			else
			{
				e.returnValue = false;
			}

/* OPERA HACK */
			window.blur();
			window.focus();

			return false;
}


Why it is still a dirty workaround: Because the user has to enable the following settings in Tools -> Preferences -> Content -> JavaScript Options...

- Allow raising of windows
- Allow lowering of windows
- Allow script to receive right clicks

That options are disabled by default and one has to tell the user to enable them. You can see the cross-browser compatible JavaScript based right click context menu at http://testground.finnrudolph.de/js/right_click_menu/

26. February 2009, 09:32:04

lucideer

a B person

Posts: 5114

Originally posted by admiralquade:

developing real webbased services and that includes total control over the interface...


<em>Well designed</em> "Real webbased services" (a) shouldn't require full control over non-standard aspects of user-input to provide the user with a flexible and complete interface, and (b) should be as accessible as possible and NEVER assume all of their users are even navigating their interface using expected methods (i.e. a mouse).

Customised right-click menus are an unnecessary gimmick. Ask yourself the real reason why you want it, because it is <em>genuinely needed</em>, or because it would be "cool" to have.

Whatever your opinion, as it's unfortunately one of the multitude of nonsense been added to html5, I'm sure Opera will be adding support for it very soon.

26. February 2009, 10:00:19

admiralquade

Posts: 14

@ lucideer: Context menus are the FASTEST way to work with content if you use the mouse. Measure the time you need to select an item, move the mouse to the menu bar, click the dropdown menu, select the function you want to use on the selected item and go back to the content. And then think about right clicking that item, move the mouse some px right and down and click the function you need. Voila. Simple, userfriendly and efficient.

The quickest way would be keyboard shortcuts, but sometimes one doesn't know them all.

I agree, that browser menus should not be suppressed globally. But sometimes it is very useful.

26. February 2009, 10:43:49

Frenzie

Posts: 14478

Originally posted by lucideer:

(b) should be as accessible as possible and NEVER assume all of their users are even navigating their interface using expected methods (i.e. a mouse).


That brings up a good point. The right-click button on the keyboard doesn't have quite the same effect. It isn't a mouse click for starters...

Originally posted by admiralquade:

Why it is still a dirty workaround: Because the user has to enable the following settings in Tools -> Preferences -> Content -> JavaScript Options...

- Allow raising of windows
- Allow lowering of windows
- Allow script to receive right clicks

That options are disabled by default and one has to tell the user to enable them. You can see the cross-browser compatible JavaScript based right click context menu at http://testground.finnrudolph.de/js/right_click_menu/


I would rather enable those on a site specific basis only, which is easy to do in Opera and/or will be when they implement this fully.

Anyway, your script contains something which is presumably a bug. You should change line 104 to something along the logic of the following, in order to allow people to actually select text. That is presuming you don't intend to surpress the normal function of left and middle click... otherwise never mind. p
if(button=="RIGHT"){
            thisObject.MouseMenu.init(e,button);
            thisObject.MouseButton.suppressBrowserMenu(e);
}
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

27. February 2009, 10:20:43

tupence

Posts: 549

Originally posted by admiralquade:

@ lucideer: Context menus are the FASTEST way to work with content if you use the mouse.


I agree, which is why I have my Opera context menu set up just the way I like it and I don't want websites making a decision for me about what should appear in my context menu.

Also, it makes the page flicker like crazy in IE7.
A straight line may be the shortest distance between two points, but it is by no means the most interesting.

Opera 12.15 build 1748 on Windows 7
Opera 12.10.ADR-1210091035 on Android 2.3.5 (Gingerbread)

27. February 2009, 14:42:30

lucideer

a B person

Posts: 5114

Originally posted by admiralquade:

@ lucideer: Context menus are the FASTEST way to work with content if you use the mouse


Exactly, and as tupence has said this is precisely they should be a browser feature and never a website feature. Browsers are about "working with content", websites ARE the content and their function should be providing and interface for the browser to work with, not overriding the WAY the browser does this.

27. February 2009, 15:56:36

Frenzie

Posts: 14478

I agree with the other guys.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

28. February 2009, 15:47:48

admiralquade

Posts: 14

@ Tupence: concerning the IE: Yeah it is a proof of concept ;D

@ Tupence, Lucideer and Frenzie: I think you got me wrong. By context menu I meant the idea of context menus, which is having the control over the content where the content is. And in some cases it makes really really sense if you disable the default browser context menu and display a css menu instead.

That could be in a list, where the left mouse button is already used for selecting a list item. Then you can right click on an item to get a context menu with all the functions displayed that are useful in THAT context. i.e. rename, delete, sort by name etc.

We already see complex webbased applications that implement JavaScript based right click context menus. Best example is http://docs.google.com/

I made this post to complain about the non conformity of Opera which by default prevents such useful (if wisely implemented) JavaScript menus. And I posted my complain here, because Opera is the only browser that does.

28. February 2009, 15:54:48

admiralquade

Posts: 14

Originally posted by lucideer:

Originally posted by admiralquade:

@ lucideer: Context menus are the FASTEST way to work with content if you use the mouse


Exactly, and as tupence has said this is precisely they should be a browser feature and never a website feature. Browsers are about "working with content", websites ARE the content and their function should be providing and interface for the browser to work with, not overriding the WAY the browser does this.



That was in the old and dark ages of the internet. Now we have powerful things like AJAX and there is a shift from "content websites" to Web applications. Which is a good thing and what we need cross-browser compatible standards for. And Opera breaks with that standard in this special case. That's my point.

28. February 2009, 17:20:46

Frenzie

Posts: 14478

I think an interface through Javascript which allows extension of the default right click menu would be better. If you look at Windows, for example, you need only open the Command Prompt to see what I mean (right click on the icon in the top left or on the taskbar). I'm not a fan of the way that particular program deals with this extensibility, but I feel that something like that would be the way to do it.

The fact that these custom right click menus will activate either after release of the right mouse button, or immediately on pressing it illustrates this well enough. It messes with the default OS behavior as picked by the user - if you're using KDE or something that is, in Windows you don't really have a choice.

Nevertheless, Opera should probably support this "feature," due to all of the other browsers. I just think the way it's implemented is at best unfortunate.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

28. February 2009, 20:34:13

lucideer

a B person

Posts: 5114

Originally posted by Frenzie:

I think an interface through Javascript which allows extension of the default right click menu would be better.


This would be perfect as long as it's extension only. Unfortunately the html5 spec seems intent on allowing preventDefault.

1. March 2009, 02:44:49

deathshadow

Excitable Boy

Posts: 741

To me, this is one of the things javascript was allowed to do that it never should have in the first place, which is why in BOTH Opera and FF one of the first things I do is go into the script settings and set "allow script to recieve right clicks" off.

Out of curiousity, how well does your little script work with that setting changed?

The reason I dislike this is the same reason I dislike the target attribute, and a whole host of other asshattery that has either been deprecated from the specification or prevented from working in browsers like Opera and Firefox. It is too easy to be abused and frankly it overrides the default behavior of the browser, something that frankly you have NO BUSINESS doing on a website in the first damned place.
So what's wrong with YOUR website? (an ongoing series)
So what's wrong with HTML 5?
Javascript is to Java as Hamburger is to Ham

1. March 2009, 14:39:45

Frenzie

Posts: 14478

Originally posted by lucideer:

Originally posted by Frenzie:

I think an interface through Javascript which allows extension of the default right click menu would be better.


This would be perfect as long as it's extension only. Unfortunately the html5 spec seems intent on allowing preventDefault.

Now here's an area where Firefox extensions could really shine. It would be possible to implement this through a Firefox extension relatively easily afaik... leaves the problem of convincing everyone that it's the way to go. p
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

1. March 2009, 16:38:00

admiralquade

Posts: 14

@ Frenzie: This thread is about cross-browser Web design ;D We should stick with the standards and not with extensions that work only for one browser... The so called "browser wars" showed that such solutions are a dead end...

If you ask yourself what the basic elements of current webdesign are, you can break it down to XHTML, CSS and JavaScript (plus files of any kind including applets). And the graphical browser should not restrict the designer (and users) of web applications in any point.

1. March 2009, 16:51:48

Frenzie

Posts: 14478

Originally posted by admiralquade:

@ Frenzie: This thread is about cross-browser Web design ;D We should stick with the standards and not with extensions that work only for one browser... The so called "browser wars" showed that such solutions are a dead end...


Is there a standard that says right click must have e.cancelable == true?

Originally posted by admiralquade:

And the graphical browser should not restrict the designer (and users) of web applications in any point.


Ah yes, that's why Internet Exploder is so secure.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

1. March 2009, 17:50:31

lucideer

a B person

Posts: 5114

Originally posted by deathshadow:

a whole host of other asshattery


oncontextmenu, window.history, target attribute, window.open and worst of all (especially in Opera where it is even more of a nuisance than IE) window.close - try pasting this in the addressbar to see what I mean: javascript:window.close();
I disagree that scripts should not be allowed to <em>detect</em> right-click, overriding it is a different story though.

Originally posted by Frenzie:

Now here's an area where Firefox extensions could really shine.


Unfortunately the record of Firefox extension developers of encouraging development of standards and cross-browser compatibility is sadly less than stellar. Some will, but certainly the vast majority are only concerned with benefiting Firefox users alone. Which is exactly the mentality of all the ActiveX/vbscript web-devs they bemoaned for so many years.

Originally posted by admiralquade:

And the graphical browser should not restrict the designer (and users) of web applications in any point.


The graphical browser should not restrict the users, and should therefore never allow the designer any opportunity to restrict the users. Restricting the designer for the benefit of users is precisely what standardisation is all about - not restricting the designer is the very reason the web is in such a mess as designers have had the freedom to use any archaic incompatible methods, and propietary technologies.

1. March 2009, 19:09:12

admiralquade

Posts: 14

Is there a standard that says right click must have e.cancelable == true?



Jepp... every other browser allows exactly that. But not Opera. So Opera breaks with a standard that is defined by the behaviour of EVERY other browser. (And what would one call a standard if not exactly that?)

The graphical browser should not restrict the users, and should therefore never allow the designer any opportunity to restrict the users. Restricting the designer for the benefit of users is precisely what standardisation is all about - not restricting the designer is the very reason the web is in such a mess as designers have had the freedom to use any archaic incompatible methods, and propietary technologies.



I totally agree with the part about letting the user make the choice how his browser renders the webcontent. And I agree, that every technology has its "dark side". i.e. the use of flash for full scale websites... or frames . o O (don't get me started wink )

But what I am talking about here is not restricting the user, but to offer him more efficient ways (better in terms of speed and intuitivity) to work with the content. That is all. And by 'offer' I mean in addition to the 'normal' interaction methods...

1. March 2009, 19:19:11

Frenzie

Posts: 14478

Originally posted by admiralquade:

Jepp... every other browser allows exactly that. But not Opera. So Opera breaks with a standard that is defined by the behaviour of EVERY other browser. (And what would one call a standard if not exactly that?)


My Konqueror behaves like Opera. p

Originally posted by admiralquade:

And by 'offer' I mean in addition to the 'normal' interaction methods...


*instead of, I'd say. In addition is what I proposed.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

1. March 2009, 19:54:09

lucideer

a B person

Posts: 5114

Originally posted by admiralquade:

And what would one call a standard if not exactly that?


That is what is called a "de-facto standard" as opposed to a standard defined by an official standards body. Both types have their pros and their cons - the main ones being:<ul>
<li>de-facto standards need not go through the same number of often extremely time consuming bureaucratic hoops before being adopted</li>
<li>official standards are usually far better, despite taking time, because they are thought out and discussed by all interested parties, as opposed to those that benefit one vendor, and are then reluctantly adopted by other vendors under pressure from an impatient user base</li></ul>
All vendors have adopted some propietary behaviours (de-facto standards if you like) that they probably shouldn't have and now possibly regret (like window.close in Opera) - but they can't remove them as some poorly made sites rely on them. In an ideal world, WebKit and Gecko would remove oncontextmenu support (and IE simply wouldn't exist), and such a silly thing would never even have been proposed for html5.

Originally posted by Frenzie:

My Konqueror behaves like Opera.


Not for long - thaven't they indicated they're phasing in WebKit in KDE4, which I guess means Squirrelfish too.

1. March 2009, 20:14:38

Frenzie

Posts: 14478

Originally posted by lucideer:

Not for long - thaven't they indicated they're phasing in WebKit in KDE4, which I guess means Squirrelfish too.


They're getting rid of KHTML? Aw damn.

Edit: actually now that I think about it I knew that - it's just been so long.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

3. March 2009, 22:49:37

admiralquade

Posts: 14

Hi again... I just updated my Proof of Concept to make my point a bit clearer wink

http://testground.finnrudolph.de/js/right_click_menu/

Changes:
- The Opera Hack is only enabled when the JS detects the browser as Opera (fixes the flickering in the IE)
- The suppressing of the default browser context menu is bound to a single div area

3. March 2009, 23:35:11

Frenzie

Posts: 14478

Maybe it's because I'm testing through VNC atm, but the suppressing of the default menu seems to fail sometimes?
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

4. March 2009, 00:15:48

HaJotKE

Grumbling Hyper-Critical Cantankerous Curmudgeon!

Banned user

Originally posted by Frenzie:

but the suppressing of the default menu seems to fail sometimes

Not here, always working fine... up
OPERA V8.54 (Win NT4) & V9.27 & V9.52[b10108] & V9.62[b10467] & V10[b1413] standard on (Win 98 SE) / (Win NT4) / (Win 2000 pro)
◇◇ UserJavascript "zz-spoof-id"! ◇◇◇ [Thanks for Finally Considering this Petition!] Composing Emails in the HTML Format in Opera

4. March 2009, 05:12:48

deathshadow

Excitable Boy

Posts: 741

Originally posted by admiralquade:

Hi again... I just updated my Proof of Concept to make my point a bit clearer wink


Doesn't work here - Oh yeah, I have my script settings set to make sure NO javascript can intercept a right click wink At least you have text to explain that, though it needs some rewording:

If you are using Opera you need to enable the following settings in Tools -> Preferences -> Content -> JavaScript Options...

* Allow spammers to sieze the focus
* Allow spammers to hide their content
* Allow script to override default browser behaviors, possibly faking the normal menu to create click-through cross scripting exploits.
So what's wrong with YOUR website? (an ongoing series)
So what's wrong with HTML 5?
Javascript is to Java as Hamburger is to Ham

5. March 2009, 21:57:05

shoust

Operaised

Posts: 3197

There is a way to stop the right click menu without needing to shift focus to another tab... this is how.

Basically you need to create a button element when right click is pressed, and then removed afterwards.

Example:

element.onmousedown=function(e){if(e.button==2){var a=document.createElement('input');a.id='rightclickhack';a.type='button';a.style.position='fixed';a.style.left=e.x;a.style.width='1px';a.style.height='1px';a.style.top=e.y;document.documentElement.appendChild(a);} // creates the button and appears briefly on right click.

element.onmouseup=function(e){if(e.button==2 && document.getElementById('rightclickhack')){document.getElementById('rightclickhack').removeNode(true)} //removes the button.


I only suggest this however on the items you want the custom right click menu in question to appear, anything else is just plain rude p

The only setting that would affect this would be the "allow scripts to recieve right clicks" setting, in which when off, this code wouldn't run.
My Opera I burning the E
Thats the way it should always B.
smile

5. March 2009, 22:05:04

Frenzie

Posts: 14478

Definitely off topic, but your site returns 404.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

5. March 2009, 22:54:03

HaJotKE

Grumbling Hyper-Critical Cantankerous Curmudgeon!

Banned user

Originally posted by Frenzie:

Definitely off topic, but your site returns 404.

Cannot confirm...
OPERA V8.54 (Win NT4) & V9.27 & V9.52[b10108] & V9.62[b10467] & V10[b1413] standard on (Win 98 SE) / (Win NT4) / (Win 2000 pro)
◇◇ UserJavascript "zz-spoof-id"! ◇◇◇ [Thanks for Finally Considering this Petition!] Composing Emails in the HTML Format in Opera

5. March 2009, 23:02:37

HaJotKE

Grumbling Hyper-Critical Cantankerous Curmudgeon!

Banned user

Originally posted by shoust:

The only setting that would affect this would be the "allow scripts to receive right clicks" setting, in which when off, this code wouldn't run.

To make it clear, the other two settings "Allow raising of windows" and "Allow lowering of windows" cut be set to NO again, which would be fine... confused

"Allow script to receive right clicks" is sometimes needed for web-sites which are unusable otherwise, therefore a case for 'Site Specific Preferences', which would be acceptable, I would believe!
OPERA V8.54 (Win NT4) & V9.27 & V9.52[b10108] & V9.62[b10467] & V10[b1413] standard on (Win 98 SE) / (Win NT4) / (Win 2000 pro)
◇◇ UserJavascript "zz-spoof-id"! ◇◇◇ [Thanks for Finally Considering this Petition!] Composing Emails in the HTML Format in Opera

6. March 2009, 02:41:34 (edited)

shoust

Operaised

Posts: 3197

Originally posted by HaJotKE:

Cannot confirm...



I took the links down in my sig because they weren't working anymore. Although almost all of my site is referenced in wayback machine, this is the last version that was on there. http://web.archive.org/web/20071226181147/http://shoust.techwhack.org/

Also...

Originally posted by HaJotKE:

To make it clear, the other two settings "Allow raising of windows" and "Allow lowering of windows" cut be set to NO again, which would be fine...


The code would run fine, because the button approach doesn't need to focus or blur a window to disable right click menu.
My Opera I burning the E
Thats the way it should always B.
smile

6. March 2009, 04:29:23

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2234

Originally posted by lucideer:

Well designed "Real webbased services" (a) shouldn't require full control over non-standard aspects of user-input to provide the user with a flexible and complete interface

To his defense, right-clicking is a standard aspect of user-input. I understand security concerns but I would like Opera to allow me to make my own security decisions instead of imposing them on me. I would like the options for pages to function the way they were intended (ie. oncontextmenu support).
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

6. March 2009, 05:33:07

lucideer

a B person

Posts: 5114

Originally posted by fearphage:

I would like Opera to allow me to make my own security decisions instead of imposing them on me


Security is not my reason for disliking oncontextmenu. I would like to make my own decisions regarding the content of (all) my browser's menus, toolbars, chrome instead of either the browser or some random website imposing them on me. I dislike oncontextmenu for the same reason I dislike the option in window.open to hide toolbars, or would dislike any remote javascript modifying my interface in any other way. (Allowing local javscript to do so would be sweet though)

6. March 2009, 12:12:50

Frenzie

Posts: 14478

Originally posted by lucideer:

Security is not my reason for disliking oncontextmenu. I would like to make my own decisions regarding the content of (all) my browser's menus, toolbars, chrome instead of either the browser or some random website imposing them on me. I dislike oncontextmenu for the same reason I dislike the option in window.open to hide toolbars, or would dislike any remote javascript modifying my interface in any other way. (Allowing local javscript to do so would be sweet though)


Quoted for (epic?) truth.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

6. March 2009, 14:37:34

woj-tek

Posts: 2334

I know i shouldn't but still: +1 for above two posts (-:

8. March 2009, 02:52:12

xErath

javascript guru

Posts: 6588

@admiralquade shoust posted the input hack.
You can see it in action in this script
http://files.myopera.com/xErath/files/oncontextmenu-emulation.js
For a collection of user scripts visit
http://my.opera.com/xErath/blog/

8. March 2009, 04:55:24 (edited)

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2234

Originally posted by lucideer:

I would like to make my own decisions regarding the content of (all) my browser's menus, toolbars, chrome instead of either the browser or some random website imposing them on me.

As a web developer, i want to write a web app and not have the browser purposely prevent it from functioning. As a consumer, i don't want to be excluded from parts of functionality. If you don't want web pages to function like applications, then you should have that right as well. I don't need Opera protecting me from the big bad world though. I'm a big boy. I can make my own decisions.

Originally posted by xErath:

@admiralquade shoust posted the input hack

that is usable but native support of the defacto standard would be optimal
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

8. March 2009, 04:34:41

lucideer

a B person

Posts: 5114

Originally posted by fearphage:

I don't need Opera protecting me from the big bad world though.


That logic is slightly flawed. If no browser were to implement the feature, no web applications would use it saving users the grief of being excluded from parts of functionality. The browser is not just protecting you from the "big bad world", it's influencing web design to prevent this "feature" being imposed on users. Simply having the feature with an option to turn it off is not providing freedom to the user as it encourages the use of the feature in web apps so the user is forced to enable it whether they like it or not if they want to use these web apps.

Of course that's all irrelevant now as other vendors have implemented the feature, and major web apps are already imposing this.

(The argument that this is needed in web apps is obviously bunk. The argument that it is more benefit than harm doesn't hold up either IMO)

8. March 2009, 10:52:00

Frenzie

Posts: 14478

Originally posted by xErath:

@admiralquade shoust posted the input hack.
You can see it in action in this script
http://files.myopera.com/xErath/files/oncontextmenu-emulation.js

It doesn't seem to work in my Opera 10.

PS, yes, I did enable allow script to receive right click and it works on for example the Warcraft page... except it still shows the context menu.
Intelligent alien life does exist, otherwise they would've contacted us. — CalendarExtend Opera

10. March 2009, 22:40:12

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2234

Originally posted by lucideer:

The argument that this is needed in web apps is obviously bunk. The argument that it is more benefit than harm doesn't hold up either IMO

Do you think the right click/ctrl-click paradigm for binary apps is wrong/bunk also? Are you a mac user by chance? Web apps are generally reproducing binary apps. The benefit is web apps are wherever the internet is. Take Microsoft Word/Excel for instance. I can use them on my computer where they are installed but if i go to my mom's, I may be out of luck. Web apps overcome this fault. In excel, when i want to make changes to the current cell, i right click the cell. Why should/would a web app function in a drastically different way? What is your suggestion for a better solution?

Originally posted by lucideer:

If no browser were to implement the feature, no web applications would use it saving users the grief of being excluded from parts of functionality.

If no browsers implemented it, it would be more difficult to mimic binary apps.
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

10. March 2009, 22:57:03

lucideer

a B person

Posts: 5114

Originally posted by fearphage:

Are you a mac user by chance?


Dear God no.

Originally posted by fearphage:

Web apps are generally reproducing binary apps.


Well I suppose it comes down to your view on the role of webapps, RIA, etc. in comparison to binary apps. Mine differs greatly from your's, and I should imagine from a good deal of people's.

Originally posted by fearphage:

Take Microsoft Word/Excel for instance. I can use them on my computer where they are installed but if i go to my mom's, I may be out of luck.


This is the purpose of standardisation, the very thing monopolisers such as MS have been stifling, and what, in the case of your example, people such as Sun are fighting for with ODF. Your mom shouldn't need to have the same app, nor should you need to resort to webapps. Portableapps is another solution I suppose - both are far superior to RIA.

11. March 2009, 04:06:05 (edited)

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2234

Originally posted by lucideer:

Mine differs greatly from your's, and I should imagine from a good deal of people's.

Well RIA is the way things tend to be going.
  • Google docs has a word processor, spreadsheet, and presentation tool (Microsoft has something similar)
  • Aviary is an online photoshop-alike
  • bespin is mozilla's code editor
Desktop apps aren't a dying breed persay but they are becoming less of a requirement. Gmail handles my mail needs, their are only irc, aim, msn, etc clients. Everything is being internet-ized. Does Gmail have custom right-click menus? I'm not sure being an opera-user but i wouldn't be surprised. Lots of only games use the right-click menu as well. It is a conventional means to contextually change a behvior/property/attribute of a particular piece of content.

Originally posted by lucideer:

This is the purpose of standardisation, the very thing monopolisers such as MS have been stifling, and what, in the case of your example, people such as Sun are fighting for with ODF.

Standardization across all platforms is a nice dream to have. RIA is the here and now. Portable apps require work on my part. I now have to remember to carry a usb key around and my mom's comp has to have usb connections (usually not a problem). More computers have access to the internet than have usb connections. Think of the people still on windows 95/98.

Originally posted by lucideer:

Your mom shouldn't need to have the same app

Does OS X come with some office suite pre-installed? Does windows? Does every distro of linux? Should they be required to? No.

@lucideer: Do you think the right click/ctrl-click paradigm for desktop apps is wrong/bunk also? What would you suggest as an acceptable way to emulate the desktop app in this aspect?
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

11. March 2009, 04:14:58

lucideer

a B person

Posts: 5114

Originally posted by fearphage:

@lucideer: Do you think the right click/ctrl-click paradigm for desktop apps is wrong/bunk also?


No, I don't. I think it's brilliant. Sorry I didn't reply to this question before, I thought it would be clear from my belief in the separation between the purposes of webapps and desktop apps. Yes, it's true, it does look as if desktop app "clones" are the new "in thing", although I hadn't heard of either of the second and third of your examples - something I take small comfort in as they've obviously not gained sufficient notoriety to reach my ears.

oncontextmenu could potentially render excellent functionality of course, in fact I have agreed in a previous post above that I would support it's adoption in a certain form (an API to extending the existing context menu rather than replacing it), but it could also (and I believe would mostly) be used for other purposes. I won't try to convert you to a webapp objector but I'll try to give you a small taste of my feeling on this. Visit any fullscreen flash site for an example. Try editing site preferences, try creating a search in their search fields, try opening with another browser, or viewing source. It can be done, but not anywhere near as conveniently unless you're a keyboard user.

11. March 2009, 04:41:46

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2234

Originally posted by lucideer:

Visit any fullscreen flash site for an example. Try editing site preferences, try creating a search in their search fields, try opening with another browser, or viewing source. It can be done, but not anywhere near as conveniently unless you're a keyboard user.

First off, I am a keyboard user so I immediately thought: alt-f12, impossible in a flash app, button on my address bar, ctrl-f3. smile i completely understand where you are coming from. However, I think oncontextmenu should be fully supported and you (the user, not opera) can decide if you want to use web apps in all their splendor and glory OR if you want to be in control and potentially be unable to access some features/functionality. I want the opportunity to make that choice. Opera is robbing me of that.
Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

11. March 2009, 05:06:10

lucideer

a B person

Posts: 5114

Originally posted by fearphage:

I want the opportunity to make that choice. Opera is robbing me of that.


At the fear of repeating myself, if browsers didn't support oncontextmenu webapp devs would be forced to find more innovative ways to offer such features to their users and users would not be forced to make a choice which would deprive them of functionality. So not supporting it effectively improves user experience as no-one is being deprived of any functionality. To summarise:

* With oncontextmenu, those who disable it are deprived of functionality in webapps.
* Without oncontextmenu, devs are forced to provide the functionality to all - noone is deprived.

Anyway, either way, agree to disagree. Btw, before I finish, do you disagree that an API to <em> extent</em> the existing context menu without allowing the webapp to actually remove/replace it would be far far better. See I'm not against the <em>use</em> of right-click on webapps, just the overriding of the existing one.

11. March 2009, 07:55:58

fearphage

Trained Swordsman of Unwanted Opera Termination

Posts: 2234

Originally posted by lucideer:

So not supporting it effectively improves user experience as no-one is being deprived of any functionality.

Your logic is flawed. More people are being deprived of functionality now than if they supported oncontextmenu. By not supporting it, 100% of Opera users are excluded from native-like RIA usage. If they supported it, none would be excluded. They would have the option to opt-out. Just like people using no-script or disabling plugins. They are sacrificing ease of use and convenience for security/bandwidth or whatever. That is the sacrifice you want to make and I'm ok with that. You seem willing to be inconvenienced as long as you control your browser experience. That's fine with me.

Originally posted by lucideer:

At the fear of repeating myself, if browsers didn't support oncontextmenu webapp devs would be forced to find more innovative ways

Why innovate a new way to do something that you already find to be a brilliant paradigm? How awkward would it be to explain to users, "You know the thing you're used to doing in every desktop application ever made, forget that. This is a web app and now you have to ctrl-click or double left click while holding shift or use a mouse gesture." Either its brilliant or its not, why does the location of the paradigm change the quality of it?

Always latest weekly; XP Pro SP2
My bugs / disable RSS subscription prompt (This will disable email and chat as well) / Receive emailed copies of your bug reports

quote from desktopteam blog Feb 23 2007 06:49.36 (direct link to comment)

Originally posted by borg:

we will not be satisfied before we have the best developer tools in the industry

Source: Mozilla Links - 5 things I’d like to see in Opera

Originally posted by Percy Cabello:

One of the main reasons I prefer Firefox is that it starts from the belief that it can’t be the ideal browser for everybody

11. March 2009, 10:52:11

lucideer

a B person

Posts: 5114

Originally posted by fearphage:

Your logic is flawed.


When applied to Opera only, my logic may be slightly flawed (only slightly), but when it is applied to all browsers (i.e. they all dumped support), it is naïvely optimistic, but perfectly unflawed.

Originally posted by fearphage:

You seem willing to be inconvenienced as long as you control your browser experience.


Willing to, if necessary, but certainly not in the slightest bit happy to.

Originally posted by fearphage:

Why innovate a new way to do something that you already find to be a brilliant paradigm?


I agree, and I would prefer a context-menu API (supplement existing rather than overriding) to no context-menu manipulation support at all. However I would prefer no context-menu manipulation support to what is being proposed in html5.

Forums » General Opera topics » Opera and cross-browser Web design