Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simple application - menu doesn't work

4 views
Skip to first unread message

stin...@zsgutova.cz

unread,
Dec 1, 2006, 1:44:25 AM12/1/06
to dev-ext...@lists.mozilla.org
Hello everybody,

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>

Neil

unread,
Dec 1, 2006, 4:16:19 AM12/1/06
to
stin...@zsgutova.cz wrote:

> 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.

stin...@zsgutova.cz

unread,
Dec 1, 2006, 6:02:59 AM12/1/06
to Neil, dev-ext...@lists.mozilla.org
Yes, they all are added. When I inspect
"chrome://browser/content/browser.xul", I see both my commands and both
menu items with appropriate commands set.

I also forgot to mention, that I use Firefox 2.0

Rgds

Roman

Nickolay Ponomarev

unread,
Dec 1, 2006, 6:09:07 AM12/1/06
to stin...@zsgutova.cz, dev-ext...@lists.mozilla.org
On 12/1/06, stin...@zsgutova.cz <stin...@zsgutova.cz> wrote:
> <commandset>
> <command id="cmd_coo1" oncommand="alert('HELLO!');"/>
> <command id="cmd_coo2" oncommand="remove2();"/>
> </commandset>
>
Try <commandset id="mainCommandSet"> so that your <command>s are
merged under existing <commandset> element.

Nickolay

stin...@zsgutova.cz

unread,
Dec 1, 2006, 7:03:00 AM12/1/06
to Nickolay Ponomarev, dev-ext...@lists.mozilla.org
Thank you, Nickolay! I knew it will be something simple :-). It works now.

Regards

Roman

0 new messages