(From http://www.xulplanet.com/references/elemref/ref_browser.html)
In firefox extension we usually use this element to load an document in the background.
I implement "Index This Link" using browser element.
How ?
- When the menu item is clicked , we
- get the link URL
- open a new window chrome://newbeagle/content/indexLink.xul , and pass URL and current window element as arguments
- get the link URL
- When chrome://newbeagle/content/indexLink.xul is loaded.
- init beagleInvisibleBrowser with opener. (the window which this window)
- load the passed URL
- once the URL is loaded.
- call winodw.opener.beagle.indexIt with the load document .
Another problem , why open a new window ?
- We can't put a browser element in the status bar / toolbar or any other place using overlay. So We have put open a new window , and put a browser element in it . (not visible,of course).
- We should let user know that we are downloading something. And also it may take some time , We must allow the user to see the process and cancel it .