Closed Bug 1892667 Opened 5 months ago Closed 3 months ago

Addon update or reload opens the addon sidebar, even if open_at_install=false and if sidebar was closed

Categories

(WebExtensions :: Frontend, defect, P3)

Firefox 126
defect

Tracking

(firefox129 fixed)

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: me+bz, Assigned: zombie)

References

Details

(Whiteboard: [addons-jira])

Attachments

(2 files)

Attached file sidebar-bug.zip

Steps to reproduce:

Our addon (Video DownloadHelper) has sidebar_action defined and open_at_install is set to false.

When the addon is reloaded (via browser.runtime.reload) or updated, the sidebar opens, even if the sidebar was originally closed, and without any user interactions.

Basically, from the point of view of our users, Firefox opens a sidebar out of nowhere. And they complain about our addon forcing the sidebar on them.

I have attached an addon to illustrate the issue.

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Component: Audio/Video: Playback → Frontend
Product: Core → WebExtensions

Note for reproducing the bug, you need to first manually show the extension's sidebar, then close it, and then reload the extension.

It looks like this condition needs an additional check to see if the sidebar is currently visible:
https://searchfox.org/mozilla-central/source/browser/components/extensions/parent/ext-sidebarAction.js#141,143

Setting to P3, patches welcome.

Severity: -- → S4
Priority: -- → P3

Oh and forgot, as a workaround, extensions should be able to both detect the sidebar was opened, and close it using the sidebarAction API.

as a workaround, extensions should be able to both detect the sidebar was opened, and close it using the sidebarAction API.

How would that work? Detecting the sidebar was open is easy enough, but how would we know it was open by the user or by Firefox?

Assignee: nobody → tomica
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Whiteboard: [addons-jira]

How would that work? Detecting the sidebar was open is easy enough, but how would we know it was open by the user or by Firefox?

I was thinking something like knowing you're being updated from the reason argument for onInstalled, and sidebars being opened within <1s from that event.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onInstalled#addlistener_syntax

… close it using the sidebarAction API.

That won't work because it requires a user trusted event :(

Attachment #9398142 - Attachment description: Bug 1892667 - Don't open a closed sidebar after extension reload r?rpl → Bug 1892667 - Don't open a sidebar for open_at_install=false after extension reloads r?rpl
See Also: → 1902664
Pushed by tjovanovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c5a4968285a1
Don't open a sidebar for open_at_install=false after extension reloads r=rpl
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: