Reputation: 2451
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
Upvotes: 1
Views: 337
Reputation: 817010
There are various ways, e.g.:
gBrowser.contentDocument
(see Tabbed Browser)window.content
(rsvp window.content.document
)window
in a script refers to the Firefox window.
Upvotes: 1