w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)
Other
576 stars 50 forks source link

"side_panel":{} declaration should automatically grant sidePanel permission #631

Open tophf opened 3 weeks ago

tophf commented 3 weeks ago

As observed in Chrome's implementation of ManifestV3, we have to add "sidePanel" to "permissions" even if we already have "side_panel": {} in manifest.json in order to use chrome.sidePanel API in the extension scripts.

This is not consistent with the conceptually identical/similar chrome.browserAction and chrome.action, which are automatically allowed when manifest.json has the corresponding section e.g. "browser_action":{} or "action":{}.

Separation is only necessary when there are two permissions e.g. "declarative_net_request":{...} has "declarativeNetRequest" and "declarativeNetRequestWithHostAccess".


Additionally, to help new developers who haven't looked at least at the beginning of the documentation page where the requirements are described and examples are demonstrated, the error message should be clarified for all such API (action, sidePanel, commands):

Cannot read properties of undefined (reading 'open'). Make sure to add "side_panel":{} to manifest.json.

tophf commented 3 weeks ago

[solomon] The issue calls out the action API as an example, but that is not really comparable since it doesn't have a permission.

The point of comparison is to show that sidePanel is an outlier that doesn't follow the established pattern.