我尝试从一个特殊的网站获取 Cookie。
清单权限:
"permissions": [
"tabs",
"*//*free-way.me",
"storage",
"cookies"
],
这是我的 popup.js:
function getCookies(domain, name)
{
chrome.cookies.get({"url": domain, "name": name}, function(cookie) {
return cookie.value;
});
}
var uid = getCookies("http://.free-way.me", "uid")
var upw = getCookies("http://.free-way.me", "upw")
document.getElementById("user").value = uid;
document.getElementById("pw").value = upw;
..但这只是告诉我,我没有权限:
cookies.get: No host permissions for cookies at url: "http://.free-way.me/".
at getCookies (chrome-extension://[...]/popup.js:19:24)
at chrome-extension://[...]/popup.js:25:13
你能告诉我我犯的错误吗?...它让我发疯。谢谢!
马库斯