开发者

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

开发者 https://www.devze.com 2023-03-07 06:50 出处:网络
I\'m writing a jquery extension where I\'m doing something like: var c = chrome.cookies.get({url:\"some-web-site\"});

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

精彩评论

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