Version: (using KDE KDE 3.1.4) Installed from: Mandrake RPMs OS: Linux The onContextMenu function is not a W3C standard but is very commonly used in webpages to control what appears when a user right clicks on a page. Both IE and Mozilla support this on the <img> and the <a> tag. It would be great if konqueror can support this functionality too. The right click functionality can be very useful for developers to provide shortcuts to certain actions in a page. The syntax is very simple. To use it from within the <a> tag, you would type : <a href="<my url>" onContextMenu="javascript:myFunction()">Click Me</a> Thanks, Jalpesh.
The event isn't supported at all, not just on IMG and A tags. Having this event would be very good to have, many web apps use it now and expect it to be cross-platform since IE and Mozilla/Netscape and Opera have it.
It is implemented in WebCore
Btw. Do you have any real-world test cases I can use, if I decide to merge it from WebCore?
It is pretty simple to test. Here is one below. Interestingly, Firefox doesn't even pass the first one! Works in IE though: <html> <head> <script> function contextTest1() { alert('Test 1 works!') } function contextTest2() { alert('Test 2 works!'); } onload = function() { document.getElementById('test2').oncontextmenu = contextTest2; } </script> </head> <body> <div oncontextmenu="contextTest()" id="test1">Right click me for test 1!</div> <div id="test2">Right click me for test 2!</div> </body> </html> By the way - if this is merged, I think there should be an option to disable it in the Javascript prefs, just like popups. While I really need support for this extention for my web application, I totally sympathize with people who get annoyed with websites that use this event for stupid reasons.
Oops - the oncontextmenu="" should be contextTest1. Thats why it failed in Firefox. Stupid typo.
> Oops - the oncontextmenu="" should be contextTest1 So why did it works in IE then? This browser is freaky.
It wouldn't work in IE either :P The syntax was wrong.
Dear user, KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6. Please migrate to use a QWebEngine based HTML component. We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes. For security issues, please see: https://kde.org/info/security/ Sorry that we did not fix this issue during the life-time of KHTML. Greetings Christoph Cullmann