Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Components.utils.import()

301 views
Skip to first unread message

antonino visalli

unread,
May 12, 2010, 5:52:06 AM5/12/10
to
I upload a .js file in another file .js. In my extension the folders
are well organized:

content /
Component /
yyy.js
modules /
xxx.js
skins /
defaults /
locate /
chrome.manifest
install.rdf

I upload the file xxx.js yyy.js file with the command
Components.utils.import ().
In the manifest file I added the line "resource pippo modules/".
In the file yyy.js recall Components.utils.import ("resource://pippo/
xxx.js"), but firefox tells me that the file is not there.
Why? What mistake?

Michiel van Leeuwen

unread,
May 12, 2010, 5:17:47 PM5/12/10
to
On 5/12/10 11:52, antonino visalli wrote:

> I upload the file xxx.js yyy.js file with the command
> Components.utils.import ().
> In the manifest file I added the line "resource pippo modules/".
> In the file yyy.js recall Components.utils.import ("resource://pippo/
> xxx.js"), but firefox tells me that the file is not there.
> Why? What mistake?

I ran into the same problem recently. I figured out that loading of the
components (so yyy.js in your case) happens before chrome registration.
So at the point that yyy.js is loaded, the resource url is not valid
yet. I didn't find a solution yet. Moving the call to
Components.utils.import into the constructor in yyy.js did make the
component load. I couldn't test it if it really works, because I need to
solve some other problems first.

hope that helps.

Michiel

johnjbarton

unread,
May 13, 2010, 12:22:32 AM5/13/10
to

I also had this experience.
jjb

>
> hope that helps.
>
> Michiel

Nickolay Ponomarev

unread,
May 13, 2010, 6:46:56 PM5/13/10
to dev-apps...@lists.mozilla.org

vettore...@gmail.com

unread,
Jul 2, 2013, 6:03:06 PM7/2/13
to
Ciao Antonio, hai risolto questo problema?
dario
0 new messages