I've written a Firefox extension which appends a menuitem onto the context menu and now i want to hide the item unless context of the click is on text.
For some reason the oncontextmenu event is never triggered ('context opened' is not shown on screen).
I've tried changing the to but still no alert being fired, anyone got an idea what i might be doing wrong here? thanks!
<?xml version="1.0"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script>
function contextClicked(){
alert('context opened')
var saveToFileItem = document.getElementById("saveToFile");
}
</script>
<menupopup id="contentAreaContextMenu" oncontextmenu="contextClicked();">
<script type="application/javascript" src="chrome://ffext/content/overlay.js"/>
<menuitem id="saveToFile" label="Save to File" oncommand="ffext.run();"/>
</menupopup>
</overlay>