Can I access the firefox plugins element from inline javascript?
I created a canvas object in my firefox plugin and now I want to access it from a webpage (the function on the webpage will only work if the plugin is installed and the browser is FF).
We now usually access DOM elements inside a page through a browser plugin. How can I access it backwards - am I getting a canvas element inside a plugin from JS inside a webpage?
Thanks Kapil
a source to share
It is not possible for JavaScript on a web page to interact with elements defined inside a Firefox extension.
Elements defined inside Firefox extensions are part of the browser user interface (chrome). Since web pages run JavaScript with limited privileges, they cannot do many things, and among them, they cannot link or interact directly with chrome elements.
JavaScript code running in the extension can access elements defined in web pages because it has high privilege. Therefore, if you want both of them to communicate, it must be initiated by the extension code.
Even so, you have to be VERY careful, or your extension could open a large security hole that could allow a malicious website to execute JavaScript with chrome privileges.
The following links can give you more information on this:
https://developer.mozilla.org/en/Security_best_practices_in_extensions
a source to share