开发者

chrome.cookies.get() Invalid value for argument 0. Property 'name'

I'm writing a jquery extension where I'm doing something like:

var c = chrome.cookies.get({url:"some-web-site"});

in my popup.html file.

When I tryt to run the extension it gives the following error:

Uncaught Error: Invalid value for argument 0. Property 'name': Property is required.

and gives jqury.min开发者_StackOverflow.js:16 as the location (I am including jquery from a google CDN).

As soon as I comment out the above code, the extension runs fine.

Any ideas?


You need to specify both url and name of the cookie.

var c = chrome.cookies.get({url:"some-web-site", name: "cookie-name"});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜