I have created an add-on using firefox’s add-on builder. I am able to create a javascript file inside add-on and can invoke a function when a user clicks on the button provided by addon.
The problem is I am not able to access firefox’s webpage from that javascript file. When I access “document” object, it seems to be different object. And window.location is shown to be “chrome://browser/content/browser.xul”
Please suggest me how to make javascript access main page.
Thanks
There are various ways, e.g.:
gBrowser.contentDocument(see Tabbed Browser)window.content(rsvpwindow.content.document)windowin a script refers to the Firefox window.