Firefox extensions run JavaScript with high privilege (chrome) and have full browser access. JavaScript code from a web page launches unprivileged JavaScript and, among other things, cannot link to or directly interact with privileged JavaScript.
In general, you should be very careful when your extension code interacts with code coming from websites so as not to open a security hole that would allow an attacker to execute JavaScript with chrome privileges.
Here you can find additional information, including code snippets, if you need to exchange data between privileged and unprivileged JavaScript:
https://developer.mozilla.org/en/Security_best_practices_in_extensions
source share