1 var cookiestr = ''; 2 chrome.cookies.getAll( 3 { 4 'url': 'https://mp.weixin.qq.com', 5 'secure': true 6 }, function (cookies) { 7 for (var i in cookies) { 8 if (typeof (i.name) != 'undefined' && typeof (i.value) != 'undefined') { 9 cookiestr += i.name + '=' + i.value + ';'; 10 } 11 } 12 alert(cookiestr); 13 14 });