TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to pre-authorize runtime permissions for Chrome extensions

1 pointsby litbear20224 months ago
I have a simple `selenium` script that does not persist user data, that is, a new `--user-data-dir` is generated each time it is started.<p>It opens some tabs and uses the Fireshot API to take screenshots.<p>However, enable the Fireshot API requires granting the runtime permission `tabs` to the extension, and it can only be operated in a GUI environment. I hope to pre-authorize the runtime permissions required by the extension when running the script. All attempts below failed:<p>- Use `options.add_experimental_option(&#x27;prefs&#x27;, prefs)` to inject the `f&quot;extensions.settings.{EXT_ID}.runtime_granted_permissions&quot;` property into the `Preferences` file - Backup and restore the `userDataDir&#x2F;Preferences` and&#x2F;or `userDataDir&#x2F;Secure Preferences` - Use `initial_preferences` to load extension - Use the Chrome group policy, Also, it is scoped to the entire system or current user, and I just want to load the policy using command line parameters so that it works for the current example - Generate new user data dir, authorized runtime permission, backup once and restore every time the script running<p>Is there any other method besides the above? I can even accept modifying the opaque sqlite files under the User Data folder or Profile folder

no comments

no comments