-1
Personal as I do to access a browser-saved cookie?
Can be by the api of mozzarella or by the api of Chrome
-1
Personal as I do to access a browser-saved cookie?
Can be by the api of mozzarella or by the api of Chrome
0
document.cookie
, containing a semicolon-separated list of items in the key pattern=value.For an implementation that covers the 3rd case you can do the following function:
var getCookies = function(){
var pairs = document.cookie.split(";");
var cookies = {};
for (var i=0; i<pairs.length; i++){
var pair = pairs[i].split("=");
cookies[(pair[0]+'').trim()] = unescape(pair[1]);
}
return cookies;
}
And use it as follows:
var myCookies = getCookies();
alert(myCookies.secret); // "do not tell you"
Source: Stackoverflow
Browser other questions tagged javascript firefox google-chrome-extension
You are not signed in. Login or sign up in order to post.
Why no vote? Any feedback is welcome.
– Felipe Augusto