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

I am writing a jquery extension where I am doing something like:

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

in my popup.html file.

When I try to run the extension, it gives the following error:

Unused error: Invalid value for argument 0. Property "name": property required.

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

As soon as I comment on the above code, the extension works fine.

Any ideas?

+3
source share
1 answer

You need to specify the URL and cookie name.

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

All Articles