Using Components.utils.import in a firefox extension
Posted
by jamesatha
on Stack Overflow
See other posts from Stack Overflow
or by jamesatha
Published on 2010-04-07T07:27:22Z
Indexed on
2010/04/07
7:33 UTC
Read the original article
Hit count: 200
firefox-extension
|JavaScript
I am trying to create some global variables in a firefox extension. In my content folder, I have two javascript files:
1) Main JS file that holds the functions for the different events, etc
2) A file that stores only an object with the pieces of state I want to maintain. Also, I set the array EXPORTED_SYMBOLS.
I am having issues with the following line found in my main JS file:
Components.utils.import("resource:///globalVariables.js");
When it is at the top of the file, nothing seems to work. If I move it into the function where I need the variable, the rest of my code works, but the function with this line does nothing. Any advice that would help me with this problem would be great. Thanks
© Stack Overflow or respective owner