My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Documentation  
How to use this plugin
Featured
Updated Oct 18, 2009 by leeor.ah...@gmail.com

Introduction

This plugin was written to try and reduce the gap between IE and FF when it comes to content that can be used in web applications. Sometimes, to create an ideal user experience you have to be able to use some native code. Many times that native code already exists in the form of an ActiveX control.

Compatibility

This plugin has been tested with FF versions 3.0 through 3.1.*, and is compatible.

Security

The lack of support for ActiveX controls in FF is definitely one of its strong point where security is concerned. This plugin does not aim to reduce the security of FF. To that end several measures have been taken:

  • The plugin will not work on regular object tags that are used to embed ActiveX controls in IE.
  • The plugin can be compiled with a list of trusted domains that will be allowed to use it. It will refuse to load ActiveX objects for any other domain.
  • The plugin can be compiled with a list of trusted control CLSIDs/PROGIDs. Again, trying to use any other control will fail.

Features

The plugin aims to provide full support for embedding ActiveX controls. Here's a list of the features provided:

  • Scriptable - Fully scriptable from Javascript, calling methods, retrieving/setting property values, etc.
  • Parameters - You can pass parameters to the embedded control.
  • Events - You can bind Javascript function to events.
  • CAB Download - You can specify a URL for downloading a CAB with the control if it does not exist.
    • The URL must match the list of trusted domain if one exists.

Preparing the Plugin for Distribution

The source stored in the SVN repository here can be considered 'vanilla' code. It has no predefined lists of trusted sites/controls. It is provided for the mere purpose of testing and performing simple POCs. The provided XPI is not signed.

If you would like to use this plugin it is strongly recommended that you fill in these lists (trusted domains, controls), choose a unique MIME Type for your purposes, and sign the XPI. Optionally, you can also provide an auto update mechanism just like with any other FF plugin.

Declaring the MIME Type

On windows, FF associates plugin with the MIME Type they have defined in their resource key named MIMEType. If you open the plugin's properties and go to the Version tab, you will have a list of resource items, MIMEType is one of those items.

To specify which MIME Type you want your version of this plugin to use, open ffactive.rc and edit the value of the MIMEType key.

Providing a Trusted Domains List

In the file ffactivex.cpp you will find the following lines:

static const char *TrustedLocations[] = {NULL};
static const unsigned int numTrustedLocations = 0;

What they mean is that any and all sites will be allowed to use this plugin you are about to compile. Assuming you will sign your plugin and have your users install it, you do not want them complaining later when some other site takes advantage of it in any way you did not intend.

TrustedLocations is an array of simple C strings, each representing a domain name. A domain name may begin with an * as a wild card (e.g. *.google.com will match code.google.com). Otherwise, the complete domain name must match exactly a member of the TrustedLocations array.

Providing a Well Known Control List

In the file axhost.cpp you will find the following lines:

static const char *WellKnownProgIds[] = {
	NULL
};

static const char *WellKnownClsIds[] = {
	NULL
};

static const bool AcceptOnlyWellKnown = false;
static const bool TrustWellKnown = false;

Same as with TrustedLocations, WellKnownProgIds and WellKnownClsIds are arrays of PROGIDs and CLSIDs respectively.

In addition, TrustWellKnown can be set to true in order to create the control using an unsafe for scripting interface. While this is a security issue, there might be a trade-off here between the user experience and security and it is left to you to decide how you want your plugin to behave.

The reasoning for this flag is that controls that are invoked through their safe for scripting interfaces sometimes prompt the user with different dialogues and therefore spoil an otherwise smooth and fluid user experience of your web application.

While these dialogues are important when the ActiveX control can be used from anywhere on the net, when its usage is restricted by following the previous guidelines, this trade-off might not be a significant one.

Embedding an ActiveX in a Web Page

FF invokes plugins for rendering content by matching the MIME type of that content as specified in the <object> tag. Here's an example:

<object
	id="Control"
	TYPE="application/x-itst-activex"
	WIDTH="300" HEIGHT="300"
	clsid="{D27CDB6E-AE6D-11cf-96B8-444553540000}"
	progid="ShockwaveFlash.ShockwaveFlash"
	event_OnReadyStateChange="OnReady"
	param_src="http://www.youtube.com/v/53RdNYwImYc">
</object>
  • type: the MIME Type the plugin is associated with.
  • clsid: is the CLSID of the control you wish the plugin to load.
  • progid: is the PROGID of the control you with the plugin to load.
  • event_XXX: tells the plugin to bind the event XXX to the Javascript function given as value.
  • param_XXX: requests that the plugin will invoke the requested ActiveX control with the parameter named XXX and set its value accordingly.
  • codeBaseURL: may be used to provide a location from which the plugin will download and install a CAB containing the needed ActiveX control.

There is no need to provide both a clsid and a progid, the above is done only for the purpose of demonstration.

Troubleshooting

First of all, get Firebug. Aside from being an invaluable tool for developing with FF, this plugin can print debug messages to Firebug's console.

Error Message: failed to create site

Check that your control is marked as 'Safe for Scripting'. The only way to load a control that is not marked as safe for scripting is to make it 'well known' (refer to Providing a Well Known Control List) and set the TrustWellKnown flag to true.

Final Note

Many people will see this project and cry about how it totally destroys the whole point, and we might as well go back and use IE. Oh well. Personally, I love FF, and now I love it even more. I have taken what I think are the needed security measures to keep this plugin safe for use, if you are not happy with it - you don't have to use it.

I hope this plugin helps people out there in creating web sites that provide a better user experience under IE and FF, while saving us programmers from writing separate code for each browser.

If you find this plugin useful and decide to use it, I'd love it if you drop me a line and tell me about it.

Comment by roeyco...@gmail.com, Jan 2, 2009

Hi Leeor, how r u? guessing right, that you're from the holy land?:)

anyway... For my question: I ran all over your documentation and downloaded the xpi file, but still haven't figure out how to use your plugin... shouldn't there be a source code? how do i make it feet for my own activeX.

thanks a head for the help Roey :)

Comment by roeyco...@gmail.com, Jan 2, 2009

ok, i found the source code download... had to search google for it. i think you're missing a link.

sorry to bother you, but how do i compile this code for firefox?

thanks again Roey

Comment by project member leeor.ah...@gmail.com, Jan 3, 2009

Yup, I'm from the Holy Land ;-)

Easiest place to find the source code is to check it out from SVN on this site. I compiled it with VS2008. You might also need a copy of the mozilla source code.

Any problems you run into, feel free to contact me through the discussion group. I want these things to be easily accessible for others later on.

Comment by roeyco...@gmail.com, Jan 13, 2009

WUHOOOOOOO great plugin :D

I managed to load my .NET ActiveX using your compiled plugin. it works great! including event and params!!

One small change from IE is that if an event returns a string, then the string goes to the activex with a '\0' at the end. In my case i wanted to concatenate with another string and it didn't work because of that.

THANK YOU VERY VERY MUCH!

Roey :)

Comment by bshafiqn...@gmail.com, Jan 15, 2009

Brilliant work, best FF plugin ever used. but One problem if I set control.someproperty=value; I got 'undefined' when i check same property i.e. alert(control.someproperty);

How to fix that issue..

I need to fix this to make it work, thanks in advance for any suggestion and help...

Kind Regards, babarnazmi

Comment by bshafiqn...@gmail.com, Jan 16, 2009

Dear All, In addition to my last post, I can only call functions but can't set properties using this plugin. I tried a lot but it is still giving me undefined values in activeX control e.g:-

xconrol.start(); //working xcontrol.a=2; //not passing values xcontrol.b=5; //not passing values var dret=xcontrol.Divide(a,b); //working var mret=xontrol.Minus(a,b); //working

Functions, start(),Divide(),Minus() are called but without any value which was passed in variables. This is very strange , Please give me some suggestions in that regards.

Thanks & Regards, babarnazmi

Comment by project member leeor.ah...@gmail.com, Jan 16, 2009

babarnazmi, the right place to ask these questions is the discussion group for this project, a link to it can be found on the project's main page.

Concerning your issues, are those properties properly exported in your .mdl file? Can you access them in IE but not in FF with this plugin?

I've tested the plugin with several different ActiveX controls, and a few others have already used it successfully, all able to set properties. That leads me to believe the problem might lie at your end.

To make sure, use a tool called OLEView, it will let you watch all the methods/properties that are available in the ActiveX control you are trying to use.

Comment by bshafiqn...@gmail.com, Jan 16, 2009

Sorry to bother you here, but I will use discussion group from now on.

It is working perfect in IE, but the behaviour in FF is strange i can set the values but it is not setting actually, I think I need to debug by some message box inside activeX control to check what kind of values it is actually passing to the control or not passing at all !!

i think there is some additional character insterted in values (as said in previous post by Roey) or something like that thats why my c++ activeX is having difficulty in understanding those values.

Thanks again for such a nice work, it is not working for me but i m still loving it.

babarnazmi

Comment by dariusz....@gmail.com, Mar 18, 2009

I assume this plugin isn't compatible with Linux? I just have tried it on Ubuntu 8.10/Firefox 3.07 an it failed :(

Dariusz

Comment by project member leeor.ah...@gmail.com, Mar 18, 2009

Well, the whole point of the plug-in is to host ActiveX controls, and I don't know any that run on Linux.

Comment by blagal...@gmail.com, Apr 2, 2009

First of all, great job! :) What I've noticed that on adding event functions like event_XXX, the event is triggered well, but the parameters are passed in reverse order. For example I had this event handler JS function:

function ObjectHit?(nMouseBtn, strObjectName)

The object name was returned in nMouseBtn, and the mouse button value in strObjectName.

I just mentioned it, not a blocker issue. Again, great job!

Comment by project member leeor.ah...@gmail.com, Apr 2, 2009

Are you using version r27?

I'll try to take a look at it soon.

Comment by blagal...@gmail.com, Apr 2, 2009

yes, that version

Comment by lxqm...@gmail.com, Apr 23, 2009

I create a simple ATL within its OnDraw?() only TextOut?() a string. In IE, it displays fine. But using this plugin in FF, there is no drawing text.Why? How to do? Thanks for answer.

Comment by rodrigo_...@hotmail.com, May 5, 2009

I'm having a problem with the download of the code for my activeX using the codeBaseURL. The .CAB file that is needed to run my application is about 3.2MB, and seems that firefox just show the message asking if I want to install the application after downloading it into some temp file, don't know exactly where. If someone try to access my website with a slow internet connection nothing happens until the download is complete. When that happens seems that my website is not working at all because there is no sing that it is downloading the codebase any where. Is there any solution for this problem? Thanks for helping

Comment by project member leeor.ah...@gmail.com, May 6, 2009

Rodrigo, please use the plug-in's google group for these questions, you can find it at http://groups.google.com/group/ff-activex-host.

Specifically, a 3.2 meg CAB file is indeed a very big one. It'll take time, and I'm not sure there's much you can do about it (probably in IE as well). But, there might be a way to let your Javascript know. Please post this question in the google group.

Comment by dariusz....@gmail.com, May 29, 2009

Are there any plans to port this plugin to Linux?

Comment by project member leeor.ah...@gmail.com, May 29, 2009

No, because there are no ActiveX controls in Linux. It's a windows only technology.

Comment by arjunaug...@gmail.com, Jul 26, 2009

I have downloaded .xpi file and already plugged with mozilla, still i am not able to view my ActiveX control in Mozilla, Could any body give me step, how to use this activeX with Mozila?

Comment by project member leeor.ah...@gmail.com, Jul 27, 2009

Please use the project's Google group to ask for help in using the plugin. There is already a lot of valuable information in the different threads, please read them carefully before asking for help - the solution is probably already there.

Comment by zwu.net@gmail.com, May 8, 2011

This is a freat plug-in. See http://elookinto.com for its great useness.

Comment by zeinkame...@gmail.com, Apr 13, 2012

JGVYGURCF

Comment by aginda...@gmail.com, Jun 16, 2012

I need help about how to call public function or public variable that wat set in active-x... on IE it is work :

var testControl; 
  testControl = document.getElementById("idObject"); 
  testControl.testPublicfunction(); 

but in chrome it doesn't. Is there any solution for this problem? Thanks for helping? thanks

Comment by chennu.o...@vayavyalabs.com, Sep 12, 2012

Hi, I need help. I am trying to create file in activex but it is not creating.

for example :- staic createfile(char file) {

fp = fopen(file, "w");
}

STDMETHODIMP VLCControl::play(void) {

createfile("play.txt");
p_instance->get_player().play();

return S_OK;

};

my mail id : obulesu.tpt@gmail.com.

Advance Thanks

please help me...

Comment by donescam...@gmail.com, May 29, 2013

Hi,

I want to use the plugin to host the CAPICOM ActiveX. In the documentation above you say:

"The plugin will not work on regular object tags that are used to embed ActiveX controls in IE. "

Does that mean that I have to recompile the plugin, hardcoding CAPICOM's CLSIDs?

Regards. donescamillo@gmail.com

Comment by eng.ahme...@gmail.com, Jan 26, 2014

when do any operation at immage and save it it doesnot save and return null at chrome

Comment by giridhar...@gmail.com, Apr 7, 2015

Hi, when I call activeX object from any js function,the processsing bar popup opens in a new window and goes to the tray of firefox. How do i get that popup in front of first firefox window? Thanks for the help.

Powered by Google Project Hosting