jssubscript-loader does not want to load script that are not local

NEW
Unassigned

Status

()

Core
XPConnect
--
enhancement
12 years ago
9 years ago

People

(Reporter: Tom Germeau, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

12 years ago
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

12 years ago
Related to bug 82187?
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?
Blocks: 82187
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: dbradley → nobody
QA Contact: pschwartau → xpconnect
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.
Severity: normal → enhancement
You need to log in before you can comment on or make changes to this bug.