| Summary: | [WebCore] javascript onContextMenu method is not supported | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Jalpesh Patadia <jpatadia> |
| Component: | khtml ecma | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED UNMAINTAINED | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Mandrake RPMs | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Jalpesh Patadia
2004-02-09 20:50:53 UTC
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 |