Idrizi.A
Idrizi.A

Reputation: 12010

Chrome extension permission (read data in a website)?

I have built a website and a chrome extension associated with it.

I want to read all data on my website (eg. read and write cookies)

So I wrote to the manifest (let's say my website is example.com, but I also use subdomains such sub.example.com) this code

"permissions": [
       "http://www.example.com/",
       "cookies"
],

But I am worried! For example If I will need any data on sub.example.com, I will have to add *.example.com to permissions which may cause disabling extension on all computer (of course, until they approve it).

Is there any way to get permissions for all my site, including subdomains, folders, www.example.com and example.com in one line.

Thanks for any help.

Upvotes: 2

Views: 542

Answers (1)

Alfred Xing
Alfred Xing

Reputation: 4632

Using *.example.com/* is the best and safest way to go. As you mentioned, the extension will be disabled but Google Chrome will pop up a notification asking for the new permissions (they'll usually click "Yes").

*.example.com/* covers www.example.com as well as example.com. It's basically saying "any URL on the host example.com.

For more info, visit the match patterns page.

Upvotes: 2

Related Questions