简体   繁体   中英

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.

How do I use new ActiveXObject in Greasemonkey?
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!).
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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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