How can I enable permissions for file:/// using chrome extensions. In my manifest.json I have tried:
"permissions": [
"file:///*"
]
and
"permissions": [
"file://*"
]
as well as
"permissions": [
"*:///C"
]
None of these work.
How to Change an Chrome Extension’s Permissions. To control an extension’s access to your data, right-click the extension’s icon on your toolbar and point to “This can read and change site data.” Choose your preferred option: When you click the extension: The extension can’t see any of your data until you click it.
Chrome app and extension permissions For administrators who manage Chrome browser or Chrome OS devices for a business or school. As a Chrome Enterprise admin, you can control whether your Chrome users can install apps or extensions based on the information an app can access—also known as permissions.
Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary. An extension can declare both required and optional permissions.
You don’t have to let your Chrome extensions take over your browser. While it’s unfortunate that Chrome extensions demand so much control over reading and changing site data by default, you can at least change the permissions for ones that are noticeably problematic in these two ways.
"permissions": [
"file://*/*"
]
Unless the extension is loaded from your local disk, file access will be disabled by default. The user has to manually approve this permission by visiting chrome://extensions/
and put a tick at the "Allow access to file URLs" checkbox.
In your code, you can see whether file access is allowed using chrome.extension.isAllowedFileSchemeAccess
.
For a user-friendly way of requesting this access, see this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With