Failed to call BHO method from Javascript in IE9

I am trying to call a BHO object method from a javascript function (javascript is injected by BHO using IHTMLWindow2 execScript).

function foo() { IEBHO.DoSomething(); } 

IEBHO is a BHO object and is already loaded in IE9.

And the DoSomething interface / method is declared in the BHO project IDL file as follows:

 [id(1), helpstring("method DoSomething")] HRESULT DoSomething(); 

This approach works fine with IE7 and IE8. The DoSomething method / interface is successfully called from a javascript function.

However, in IE9, it seems to fail. It seems that javascript could not find the IEBHO object in its namespace, which causes the DoSomething method to fail.

I even used the IE7 / IE8 document mode inside IE9, and they all work fine, but once it is set to IE9 document mode by default, it fails.

Is this a bug in IE9? or is there a new way to access the BHO method?

Please, help...

Yours faithfully,

Franc

+6
javascript internet-explorer-9 bho
source share
2 answers

For beer time, make sure BHO is enabled in IE9

extensibility

In Internet Explorer 9, the extensibility mechanisms for the browser Assistant Objects (BHOs) and toolbars remain the same. Not loading BHOs ​​or toolbars improves startup time, but limits the ability of developers to increase user experience due to this extensibility mechanisms.

via http://en.wikipedia.org/wiki/Internet_Explorer_9

+1
source share

You can create an extension simply by creating keys in the registry with a javascript file.

In this javascript file, you can call the BHO function DoSomething (). When you press the button on the command bar, the BHO function is called.

0
source share

All Articles