简体   繁体   English

如何在Greasemonkey中使用ActiveXObject?

[英]How do I use ActiveXObject in Greasemonkey?

I tried: 我试过了:

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

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

in Firefox Greasemonkey, but it returns an error. 在Firefox Greasemonkey中,但返回错误。

How do I use new ActiveXObject in Greasemonkey? 如何在Greasemonkey中使用new ActiveXObject
Thank you ^_^ My friend. 谢谢^ _ ^我的朋友。

You cannot use ActiveX from Greasemonkey, because you cannot use ActiveX from javascript in Firefox (Or any sane browser, thank God!). 您不能使用Greasemonkey的ActiveX,因为您不能使用Firefox中的javascript (或任何理智的浏览器,感谢上帝!)中的ActiveX
There used to be some, very dicey, add-ons for Firefox that allegedly provided support, but there is nothing safe that works with recent/current versions of Firefox . Firefox曾经有一些非常简单的插件,据称提供了支持,但没有安全的版本可与Firefox的最新/当前版本一起使用

Now, you might possibly be able to write your own Firefox extension or plugin for this, but I recommend that you find a better way to do whatever it is you are trying to do , that does not use ActiveX in any manner. 现在,您也许可以为此编写自己的Firefox扩展或插件,但是我建议您找到一种更好的方法来完成您要尝试执行的操作 ,而不以任何方式使用ActiveX。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM