I'm new to this list and new to extensions in general, so please have
patience with me :-).
I need to remove certain cookies from time to time. So I decided to add
small submenu to Tools menu to do this. While testing, I don't install
it regular way, I just copy it to ext. folder.
Now the menu is added to Tools menu, I see no errors in err console. But
when I choose the menuitem, no command is done. I even changed the
command to simple alert, but it just doesn't work. JavaScript part is
not important right now, because it works fine when I type it to Error
console to "evaluate" field. It removes cookie correctly. I just don't
know why the menu doesn't work. Probably something stupid, but I'm just
lost.
See files below. Do you have any idea why this doesn't work?
Thank you in advance
Roman
-----------------------------------
sc-menu.xul
<?xml version="1.0"?>
<overlay id="singleItemEx"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="sc-menu.js"></script>
<commandset>
<command id="cmd_coo1" oncommand="alert('HELLO!');"/>
<command id="cmd_coo2" oncommand="remove2();"/>
</commandset>
<menupopup id="menu_ToolsPopup">
<menuseparator id="sc-separator" position="5"/>
<menu id="sc-menu" label="Cookies Test" position="6">
<menupopup id="sc-popup">
<menuitem label="Cookies - 1" command="cmd_coo1" />
<menuitem label="Cookies - 2" command="cmd_coo2" />
</menupopup>
</menu>
</menupopup>
</overlay>
-----------------------------------
chrome.manifest
content scclean chrome/content/
overlay chrome://browser/content/browser.xul
chrome://scclean/content/sc-menu.xul
-----------------------------------
install.rdf
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>scc...@sc.test</em:id>
<em:version>0.1</em:version>
<em:type>2</em:type>
<!-- Target Application this extension can install into,
with minimum and maximum supported versions. -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>2.*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>SC Cookies Remover</em:name>
<em:description>Test Cookie Remover</em:description>
<em:creator>Ramon</em:creator>
<em:homepageURL>http://none/</em:homepageURL>
</Description>
</RDF>
> Do you have any idea why this doesn't work?
Try using DOM Inspector to verify that your <command> got added as well
as your <menuitem>.
--
Warning: May contain traces of nuts.
I also forgot to mention, that I use Firefox 2.0
Rgds
Roman
Nickolay
Regards
Roman