Closed Bug 203091 Opened 21 years ago Closed 13 years ago

Add NSActiveXObject for exposure to JavaScript API

Categories

(Core :: XPConnect, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: arun, Assigned: dbradley)

References

Details

This bug is with reference to the tentative ActiveX implementation (see
http://www.iol.ie/%7Elocka/mozilla/plugin.htm for more details) which currently
builds turned OFF in Mozilla.

We should expose the following to JavaScript in web pages:

1. An NSActiveXObject that matches the ActiveXObject implementation in IE.  Note
that we are not going to expose ActiveXObject since that implies that ActiveX
support is completely on par with IE.

2. The NSActiveXObject should behave as IE's ActiveXObject behaves, e.g.

var control = new NSActiveXObject("progID") should be valid *programmatic
instantiation* of supported prodIDs.  
Perhaps also: var control = new NSActiveXObject("classID") but I'm not so sure
about this one.

3. We should expose a way to test if a given classID is supported by Gecko (in
the whitelist) or if it exists on a machine.  Perhaps this can be nuanced into
two properties (up for discussion) but I propose:

NSActiveXObject.supports("progID") and also the overloaded
NSActiveXObject.supports("classID") as booleans.

True means that the control works with Gecko, but gives no indication whether it
is installed on the system or not.

False means that the control does not work with the current version of Gecko.

Checks for installation may be a secondary problem *and may necessiate* another
property, however:

1. IE's JSCript ActiveXObject can be used to check if a component is installed and
2. IE's VBScript CreateObject can be used to check if a component is installed
and has been successfully instantiated.

Since this is a brand new object that developers who deploy to IE are going to
have to learn about anyway, we may as well add the properties and methods that
we think will be most useful.
Status: NEW → ASSIGNED
Depends on: 203093
I'm not sure if renaming ActiveXObject is going to help. Sites that use some
other test mechanism (e.g. document.all), or just insert an OBJECT tag are still
as likely to break whether we rename it not. And for those sites that *might*
work because they do test ActiveXObject instead of document.all, they won't at
all now.

Even testing for ActiveXObject in IE doesn't imply it is actually enabled. For
example this sample will print out the same message in IE even when all ActiveX
support is disabled.

<html>
<head><title>ax test</title></head>
<body>
<script>
if (window.ActiveXObject)
  document.write("You have activex");
else
  document.write("You don't have activex");
</script>
</body>
</html>
The problem is that sites are testing for xmlhttprequest using
window.activexobject for ie, else they check for gecko's implementation.

Yes, its a bad thing to do, but its out there and will break sites that
currently work with us.
Ouch :) I guess if its a serious problem we would have to rename then.
QA Contact: pschwartau → xpconnect
The ActiveX embedding API was removed in bug 662023 and friends.

-> INVALID

[Filter bugspam on activexinvalid]
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.