Extension: request host permission dynamically instead of relying on CORS

Backend CORS is disabled by default (origin: false), and an unpacked
extension's ID isn't fixed/predictable per install anyway, so allowlisting
it server-side would be awkward. options.js now calls
chrome.permissions.request() for the entered base URL on Save — once
granted, the extension's own fetches bypass CORS entirely for that origin.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-09-01 18:49:28 +00:00
parent 4d3774ef0d
commit 28d3db8039
2 changed files with 20 additions and 0 deletions

View file

@ -11,6 +11,8 @@
"https://login.newbook.cloud/*"
],
"optional_host_permissions": ["http://*/*", "https://*/*"],
"background": {
"service_worker": "background.js"
},