web-scraper-chrome-extension
web-scraper-chrome-extension copied to clipboard
Access data dynamicly for relevant sites
Currently the manifest requires permision for all urls. Some users might prefer least needed permisions from the app. A solution for that might be adding that permision as an optional permission and asking user to add permission for data of new sites added to the extention.
example for making data for domains an optional permission that can be asked later from the running extention at runtime:
manifest.json
...
"optional_permissions": [ "http://*/", "https://*/" ]
...
example for asking permission for a new site at runtime:
chrome.permissions.request({
origins: [protocol +"://"+ domain +":"+ port+"/"]
}, function(granted) {
// The callback argument will be true if the user granted the permissions.
if (granted) {
alert("amazing things happend here")
} else {
alert("Without permision to the site the app can't work")
}
});