Bug 1690613 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Bug 1679688 changed some internals so that the tab's url, title and favIconUrl of various APIs are shown if the extension has host permissions, instead of only when the extension has the "tabs" permission (or activeTab).

The tab descriptors returned by the `sessions` API have `url`, `title` and `favIconUrl` properties too, but these still require the `"tabs"` permission. For consistency with the rest of the extension API, we can also consider exposing details of the tab when the extension has host permissions.

Fixing this bug is not difficult:
- Replace the check at https://searchfox.org/mozilla-central/rev/927e525f481a93a8f63d27a78ae6201e42b1b1fb/browser/components/extensions/parent/ext-browser.js#956 (see the linked bug for examples)
- Add a unit test that verifies that the properties are present without the "tabs" permissions, at https://searchfox.org/mozilla-central/rev/927e525f481a93a8f63d27a78ae6201e42b1b1fb/browser/components/extensions/test/browser/browser_ext_sessions_getRecentlyClosed_tabs.js

Once this bug is fixed, we should update the documentation at:
- https://github.com/mdn/content/blob/c1a1777e56efd9f3bcec94befc2507506154408d/files/en-us/mozilla/add-ons/webextensions/api/windows/window/index.html#L46
Bug 1679688 changed some internals so that the tab's url, title and favIconUrl of various APIs are shown if the extension has host permissions, instead of only when the extension has the "tabs" permission (or activeTab).

The tab descriptors returned by the `sessions` API have `url`, `title` and `favIconUrl` properties too, but these still require the `"tabs"` permission. For consistency with the rest of the extension API, we can also consider exposing details of the tab when the extension has host permissions.

Fixing this bug is not difficult:
- Replace the check at https://searchfox.org/mozilla-central/rev/927e525f481a93a8f63d27a78ae6201e42b1b1fb/browser/components/extensions/parent/ext-browser.js#956 (see the linked bug for examples)
- Add a unit test that verifies that the properties are present without the "tabs" permissions, at https://searchfox.org/mozilla-central/rev/927e525f481a93a8f63d27a78ae6201e42b1b1fb/browser/components/extensions/test/browser/browser_ext_sessions_getRecentlyClosed_tabs.js

Once this bug is fixed, we should update the documentation at:
- https://github.com/mdn/content/blob/c1a1777e56efd9f3bcec94befc2507506154408d/files/en-us/mozilla/add-ons/webextensions/api/windows/window/index.html#L46
- this page is rendered at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/sessions/Session#type

Back to Bug 1690613 Comment 0