Closed hartleybrody closed 10 years ago
Got it working by doing a monkeypatch :monkey_face: In kango/builders/chrome.py
, on line 128, the code checks to see if the info.permissions["content_scripts"]
list from the extension_info.json
file is different from the default of ["https://*/*", "http://*/*"]
. I added some lines to not only update the content scripts matches part of the manifest, but also the permissions part of the manifest.
Basically, changing this
if info.permissions['content_scripts'] != self.DEFAULT_CONTENT_SCRIPTS_MATCHES:
manifest['content_scripts'][0]['matches'] = info.permissions['content_scripts']
to
if info.permissions['content_scripts'] != self.DEFAULT_CONTENT_SCRIPTS_MATCHES:
manifest['content_scripts'][0]['matches'] = info.permissions['content_scripts']
manifest['permissions'].remove("http://*/*")
manifest['permissions'].remove("https://*/*")
manifest['permissions'].extend(info.permissions['content_scripts'])
Please try to use permissions.xhr
. extenssion_info.json
example:
{
"permissions": {
"content_scripts": ["http://www.blogger.com/"],
"xhr": ["http://www.blogger.com/"]
}
}
The extension I'm building only needs to run the content script on a few domains. It shouldn't have to request the
https://*/*
andhttp://*/*
permissions which tell the user it can access data on "All Websites" on the install confirmation pop-down.I'd be happy with a chrome-only solution, but there doesn't appear to be a way to specify that I'd like to only have certain match patterns in the permissions, not all sites. Any tips?