Activexobject in Firefox or Chrome (Not Ie!)

ActiveXObject in Firefox or Chrome (not IE!)

ActiveX is only supported by IE - the other browsers use a plugin architecture called NPAPI. However, there's a cross-browser plugin framework called Firebreath that you might find useful.

ActiveXObject works in IE, but not in Firefox

You can't. ActiveX is an IE-only thing. If you need cross-browser support, you're gonna have to re-think what you're trying to do...

How To Run Active X Objects in Non-IE Browsers?

Here are some things to consider:

  1. You should never do this

  2. Seriously, never ever do this

  3. No, really, I'm not kidding. One slight mistake in your security model, and you will be the internet pariah of the year. Do not do this.

  4. If you're going to go ahead and do it anyway, you'll need an NPAPI plugin. Note that Chrome has announced that they will eventually be dropping support for NPAPI -- we don't know how soon, and given that they haven't provided adequate solutions for a large number of problems currently solved by plugins I'm hoping it's not in the next couple of months, but once they do you'll need to use Native Client on Chrome, and NPAPI on the other ones. For an NPAPI plugin you could look at FireBreath, which is a framework that allows you to create a plugin that works both as NPAPI and ActiveX

  5. Any option that will allow you to do this will require the user to download and install something. There is no way around this, nor should there be.

  6. Most web browsers run in user mode, i.e. not in administrator mode. Generally when not in administrator mode you have -- at best -- read only access to the System32 directory. If you need any better you'll have to launch another application that will request elevation and proxy commands to it from the plugin.

In short:

  • This is a bad idea
  • It's a pain in the neck
  • It's really easy to make mistakes that would allow malicious attacks on users computers through your plugin.
  • What you're talking about doing is really significantly more dangerous than I'm making it sound, but I don't know how to fully explain just how bad of an idea this would be.

What is the solution for reference error with javascript?

How to resolve this?

Check if the object exists before you try to use it. Perhaps something like this:

if (typeof(window.ActiveXObject) != "undefined") {
// your code
}

Also let me know if there a better way to have feature to copy files which is compatible on all browsers.

There isn't. Your code only works because the user has permitted a browser extension to allow it to work. Browsers which don't have that extension, or users which don't permit it, won't work. By default you can't control the file system from within the browser (for obvious security reasons).



Related Topics



Leave a reply



Submit