You can found all basic steps in above link and some of my findings are below
1) Menu ,Menu Items and Tools bars can be added using xul controls but some times we need to add menu-items in existing firefox menus for example file-->My Hello World Menu-Item
You need to understand browser.xul file for this case which is located under $Mozilla-Home/lib/browser.jar/content/browser
For example we need to add menu-item under file menu which id in browser.xul file is id="menu_FilePopup"
So write in plug-in xul file
<menupopup id="menu_FilePopup"> <menuitem id="helloworld-hello" label="&helloworld; nsertafter="menu_saveFrame" oncommand="HelloWorld.onMenuItemCommand(event);"/> </menupopup> Note: menu_saveFrame is id save menu-item under file menu |
2) Second I need to get current content url or current tab url with in plug-in's javascript files which can be get by using window.content.document.location not by window.location
No comments:
Post a Comment