javascript - 如何在 Greasemonkey 中使用 ActiveXObject?

标签 javascript firefox activex greasemonkey

我尝试过:

function AddEmotion(strUrl)
{
    try
    {
        var cpAdder = new ActiveXObject("QQCPHelper.CPAdder");

        if (strUrl != "")
        {   
                cpAdder.AddCustomEmotion(strUrl);
        }
    }
    catch(e)
    {
        alert("error");
    }
}

在 Firefox Greasemonkey 中,但它返回一个错误。

如何在 Greasemonkey 中使用new ActiveXObject
谢谢你^_^我的 friend 。

最佳答案

您无法使用 Greasemonkey 中的 ActiveX,因为 you cannot use ActiveX from javascript in Firefox (或者任何正常的浏览器,感谢上帝!)。
曾经有一些非常危险的 Firefox 附加组件据称提供了支持,但是there is nothing safe that works with recent/current versions of Firefox .

现在,您也许可以为此编写自己的 Firefox 扩展或插件,但我建议您找到一种更好的方法来完成您想要做的任何事情,这确实不以任何方式使用 ActiveX。

关于javascript - 如何在 Greasemonkey 中使用 ActiveXObject?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16208810/

相关文章:

java - 使用selenium获取页面源代码,如何在没有firefox的服务器上使用我的代码?

.net - 如何注册 .net exe 公开的 com 接口(interface)?

Excel Activex 列表框可在选择同一单元格时打开和关闭,而无需先单击另一个单元格

javascript - Angular 2+ 中 *ngIf 条件下的代码多久触发一次?

javascript - 编写原型(prototype)来检查字符串是否为大写

javascript - Mongoose 属性过滤器

javascript - 使用 javascript 调用 Applet.getMethod() 会抛出错误消息 : TypeError: Applet. getMethod() 不是函数

firefox - 运行 MTAF 时使用 selenium server 2.24.1 和 firefox 13 截屏

activex - 是否可以在接受 activex 对象后避免页面重新加载

javascript - 如何从异步调用返回响应?