The document.Script object is not supported




11 years ago
7 years ago


(Reporter: Mark Heily, Unassigned)



Firefox Tracking Flags

(Not tracked)




(1 attachment)



11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060601 Firefox/ (Ubuntu-edgy)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060601 Firefox/ (Ubuntu-edgy)

An web application that our company licenses for internal use doesn't work with Firefox due to it's use of the non-standard (IE) object 'document.Script'.

The document.Script object is a non-standard IE extension to the DOM. A Mozilla porting guide[1] notes that Mozilla does not allow DOM elements to be accessed via 'document.elementName'. 

Please see the attached testcase for a complete example of the problem. 


Reproducible: Always

Steps to Reproduce:
1. Create an HTML file with a JavaScript <script> block.
2. Write an example function named 'foo' 
3. Try to invoke the function using ''
Actual Results:  
The foo() function is not invoked.

Expected Results:  
The foo() function should be invoked.

Comment 1

11 years ago
Created attachment 257406 [details]
Demonstrates the use of document.Script
Does it have any actual purpose? And perhaps more importantly, has it ever been documented, anywhere? I couldn't find a shred of documentation, and the few non-Pascal instances knows of seem to be "how to prompt for user input from WSH by creating an instance of IE and manipulating it."
Assignee: nobody → general
Component: General → DOM
OS: Linux → All
Product: Firefox → Core
QA Contact: general → ian
Hardware: PC → All
Version: unspecified → Trunk

Comment 3

11 years ago
(In reply to comment #2)

appears to be a synonym for window as ie7 alerts true for 
javascript:alert(window == document.Script)

Comment 4

11 years ago
This appears to be a strange and undocumented IE hack. I was also unable to find any documentation for the document.Script object.

The web application was using it as a convenience to allow functions from other pages to be invoked without continually referring to the absolute DOM location of the page containing the function.

For example, at the top of the script it would create a global dispatch variable named 'obj':

    var obj = parent.document.Script;

This creates an object whose methods are aliases to all of the functions contained in the parent document. And then throughout the rest of the script it would call methods of 'obj' instead of directly calling the function from the parent page.

For example, they would call:


Instead of calling:


Don't ask me why or how the developers of the web application decided to use this undocumented technique. I have sent them a bug report asking them to use a more normal way to invoke functions. 

Comment 5

11 years ago
Note that doing:

  var obj = parent;

... would work as well.

Comment 6

9 years ago
Is the Script object mentioned here the same that has been removed in Firefox 3?
There's anote about it in "Firefox 3 for developers":

If that's the case, this bug is either Won'tFix or Invalid.
Not an extension we're going to want to support, given the craziness and lack of documentation.  From what you described, |obj = parent.document| would have the same effect.
Last Resolved: 9 years ago
Resolution: --- → WONTFIX
shaver: obj = parent, not object = parent.document.

In reply to comment 6, no, this is nothing to do with the SpiderMonkey Script object, late and unlamented.



7 years ago
Assignee: general → nobody
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.