KangoExtensions / kango

Kango framework issue tracker
74 stars 7 forks source link

kango.browser.cookies.getCookies Firefox #109

Closed fredopahu closed 9 years ago

fredopahu commented 9 years ago

Hello,

kango.browser.cookies.getCookies() doesn't seem to work in Firefox. Here is the output : "Components is not defined"

Same function works well in Chrome.

Is there a workaround ?

Thank you

fredopahu commented 9 years ago

Workaround so far :

function GetCookie(){
    try
        {
        kango.console.log("Getting Cookies");
            var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
        var uri = ios.newURI("http://www.example.com/", null, null);

        var cookieSvc = Components.classes["@mozilla.org/cookieService;1"].getService(Components.interfaces.nsICookieService);
        var cookie = cookieSvc.getCookieString(uri, null);

        kango.console.log(cookie);
        }
        catch (errorInfo)
        {
            kango.console.log(errorInfo);
        }

    }

Can be used directly in background script.

akrylysov commented 9 years ago

Thank you for report, the issue will be fixed shortly.

akrylysov commented 9 years ago

Was fixed.