Last Comment Bug 307686 - jssubscript-loader does not want to load script that are not local
: jssubscript-loader does not want to load script that are not local
Status: NEW
:
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: Trunk
: All All
: -- enhancement (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: 82187
  Show dependency treegraph
 
Reported: 2005-09-09 05:31 PDT by Tom Germeau
Modified: 2008-01-21 13:36 PST (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Tom Germeau 2005-09-09 05:31:29 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; nl-BE; rv:1.7.10) Gecko/20050716 Firefox/1.0.6 (ax)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl-BE; rv:1.7.10) Gecko/20050716 Firefox/1.0.6 (ax)

when you load a script from http:// with jssubscript-loader it returns an
exception: "ContentLength not available (not a local URL?)"


Reproducible: Always

Steps to Reproduce:
var scriptinc =
Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService()
  .QueryInterface(Components.interfaces.mozIJSSubScriptLoader);
scriptinc.loadSubScript("http://foo.com/script.js");
Actual Results:  
Exception

Expected Results:  
script.js should be loaded
Comment 1 zug_treno 2005-09-10 04:10:57 PDT
Related to bug 82187?
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2005-12-29 00:01:57 PST
The problem is that the subscript loader does sync loads, and those don't really work for non-local stuff very well.  The loader _could_ not bother with the content-length and just read data till it gets no more, though...  Would that make more sense?
Comment 3 Myk Melez [:myk] [@mykmelez] 2008-01-21 13:36:37 PST
Note that mozIJSSubScriptLoader.idl <http://lxr.mozilla.org/mozilla/source/js/src/xpconnect/idl/mozIJSSubScriptLoader.idl>, a frozen interface, says explicitly that it will only load local URLs:

 54      * @param url the url if the sub-script, it MUST be either a file:,
 55      *            resource:, or chrome: url, and MUST be local.

So this seems like an enhancement that will require a mozIJSSubScriptLoader2 interface.

Note You need to log in before you can comment on or make changes to this bug.