gpt4 book ai didi

javascript - 无法在 IE9 中从 Javascript 调用 BHO 方法

转载 作者:数据小太阳 更新时间:2023-10-29 05:36:59 26 4
gpt4 key购买 nike

我正在尝试从 javascript 函数调用 BHO 对象方法(BHO 使用 IHTMLWindow2 execScript 注入(inject) javascript)。

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

IEBHO 是一个 BHO 对象,已经在 IE9 中加载。

“DoSomething”接口(interface)/方法在 BHO 项目的 IDL 文件中声明为:

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

这种方法在 IE7 和 IE8 上运行良好。从 javascript 函数成功调用方法/接口(interface)“DoSomething”。

但是在 IE9 中,它似乎总是失败。 javascript 似乎无法在其命名空间中找到 IEBHO 对象,这导致调用“DoSomething”方法失败。

我什至在 IE9 中使用了 IE7/IE8 文档模式,它们都可以正常工作,但是一旦将其设置为默认的 IE9 文档模式,它就会失败。

这是IE9的BUG吗?或者有一种新的方法来访问 BHO 方法?

请帮忙...

最好的问候,

弗兰克

最佳答案

第一次,请检查您的 IE9 中是否启用了 BHO

Extensibility

In Internet Explorer 9, the extensibility mechanisms for Browser Helper Objects (BHOs) and toolbars remain the same. Not loading BHOs or toolbars improves startup time, but limits the ability of developers to augment the user experience through these extensibility mechanisms.

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

关于javascript - 无法在 IE9 中从 Javascript 调用 BHO 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5402422/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com