Extension with wss:// host_permissions can't be uploaded to web store

116 views
Skip to first unread message

wong2

unread,
Aug 31, 2023, 4:09:56 AM8/31/23
to Chromium Extensions
I need to modify the header of a websocket request wss://chat.exaple.com, so I'm using chrome.declarativeNetRequest (and resourceType websocket), but the normal host_permissions `https://*.example.com/` won't match the request. So I added `wss://*.example.com` to host_permissions, and it works in developer mode.
But when uploading it to Chrome web store, I get an error message of wrong host_permissions declared in manifest.json

Here is how I finally get it to work:
1. remove the wss:// permission from host_permissions
2. add `wss://*/*` to optional_host_permissions
3. Request permission of `wss://chat.example.com` at runtime with chrome.permissions.request API.

I think there are some inconsistent behaviours here, hope I can get some clarification here.
Reply all
Reply to author
Forward
0 new messages