[EMAIL PROTECTED] wrote:


I'm developing on Firefox 1.0.
why can't i load a subscript from a XPCOM Component
written in Javascript from a chrome: path?

The chrome path is valid, the javascript file exists and
is displayed if i enter the chrome URI in the browser.

This is my code, with the file: scheme it works fine.

// this works:
Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader)
.loadSubScript("file:///path/to/common.js");

// this won't work:
// .loadSubScript("chrome://myextension/content/common.js");

The docs <http://www.xulplanet.com/references/xpcomref/ifaces/mozIJSSubScriptLoader.html> suggest chrome should work. Do you get any script error displayed in the JavaScript console?

--

        Martin Honnen
        http://JavaScript.FAQTs.com/
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to