Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access data dynamicly for relevant sites #73

Open
jNullj opened this issue Oct 5, 2020 · 0 comments
Open

Access data dynamicly for relevant sites #73

jNullj opened this issue Oct 5, 2020 · 0 comments

Comments

@jNullj
Copy link

jNullj commented Oct 5, 2020

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")
		}
	});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant