Last active
August 29, 2015 14:20
-
-
Save skipme/58470cf6f43b830cf572 to your computer and use it in GitHub Desktop.
Cookies, MDN, addon SDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Cc = require("chrome").Cc; | |
var Ci = require("chrome").Ci; | |
var SERVICES_COOKIE = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2); | |
this.cookies = ""; | |
var enumc = SERVICES_COOKIE.getCookiesFromHost("*.example.com"); | |
while (enumc.hasMoreElements()) | |
{ | |
var cookie = enumc.getNext().QueryInterface(Ci.nsICookie2); | |
if(!cookie.isHttpOnly) | |
this.cookies += cookie.name + "=" + cookie.value+"; "; | |
// console.log(cookie.rawHost) | |
//dump(cookie.host + ";" + cookie.name + "=" + cookie.value + "\n"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment