Apr/080
Firefox: Enable custom javascript context-menus
I want to replace or disable the browsers context menu on some pages. This task is not as easy as it sounds. There are some cross-browser issues with e.g. opera and safari. In the mentioned case this is no problem for me: Support for Firefox and Internet Explorer is enough.
But even full firefox support is not easy to realise. I had a problem with a firefox installation on ubuntu gutsy. When I called the contextmenu by doing a right-click on the page the default browser context menu opened (The custom context menu was covered by the default context menu). I knew the javascript code was correct cause it worked with some IEs, with the Firefox on a Windows system and also with the Firefox on another Linux system. So what’s the problem?
Firefox has an option which can be set by the user to prevent overriding the context menu by javascript. You can change the option as follows:
This option can be changed by calling about:config in the address bar and setting the option dom.event.contextmenu.enabled to True.
The option can even be changed through the Firefox GUI: “Tools > Options > Content > Advanced > Disable or replace context menus”.
Hope this saves someones time…
Popular
Random
Categories
- Blog (12)
- Crap (6)
- HP 2133 (7)
- HTPC (8)
- Javascript (9)
- Link collection (6)
- Monitoring (2)
- Nagios (44)
- Open Source (34)
- Perl (2)
- PHP (4)
- Software Tipps (14)
- VBS (2)
- Windows (7)
- WL-500gp (2)
Blogroll







