Close sidebar or popup (addons)
Categories
(WebExtensions :: General, defect)
Tracking
(Not tracked)
People
(Reporter: mprops, Unassigned)
References
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0
Steps to reproduce:
I notice that now on FF 133 b8 that window.close() also affects the sidebar now, it closes the sidebar. It used to be that it would ignore the sidebar, and apply only to popups. So I built based on that.
Actual results:
However now window.close() closes the sidebar, as well as the popup, so now my extension needs to adapt.
Expected results:
How can I either detect if it's a sidebar or a popup, to know what to do depending on which. Or, how can I close selectively only the sidebar, or only the popup, programmatically?
Comment 1•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Sidebar' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
On element I got this answer which I guess fixes the issue:
f you are re-using the HTML document, you could still append a query string or reference fragment after the file name, e.g. ?popup and ?sidebar to distinguish the two, and use location.search to look up that value
Comment 3•3 months ago
|
||
(In reply to mprops from comment #2)
On element I got this answer which I guess fixes the issue:
f you are re-using the HTML document, you could still append a query string or reference fragment after the file name, e.g. ?popup and ?sidebar to distinguish the two, and use location.search to look up that value
So it the issue fixed?
As long as I can discern between popup and sidebar it is fixed for me. So right now it's fixed, even if the solution is a bit hacky, and hopefully not prone to be removed in the future (appending ?popup/?sidebar).
Comment 5•3 months ago
|
||
(In reply to mprops from comment #2)
On element I got this answer which I guess fixes the issue:
f you are re-using the HTML document, you could still append a query string or reference fragment after the file name, e.g. ?popup and ?sidebar to distinguish the two, and use location.search to look up that value
Hi, is this from documentation for the extension sidebar API? A link would be helpful here, as it seems like something might need to be updated?
Btw it's missing the first letter it's "If you are" etc.
Probably not in the documentation. I got this from a user in the matrix, addons channel.
This should be documented somewhere in the addons pages.
Comment 7•2 months ago
•
|
||
Sending this over to addons team as it sounds like something might need to be updated.
mprops, could you better explain what you're trying to do with your extension. Maybe a screenshot or screencast would help as the issue is a bit vague (what has changed and how exactly its affecting your extension).
Updated•2 months ago
|
Comment 8•2 months ago
|
||
Hello mprops !
Would you mind attaching a test extension so I can try and confirm this issue? Thank you !
Comment 9•2 months ago
|
||
Closing the sidebar when window.close()
is called is intentional. We haven't documented the change, but we should.
(In reply to mprops from comment #0)
How can I either detect if it's a sidebar or a popup, to know what to do depending on which. Or, how can I close selectively only the sidebar, or only the popup, programmatically?
If you want to reuse the HTML page, you can add a query string to the popup/sidebar definition, e.g. panel.html?sidebar
, and use location.search
and/or URLSearchParams
to parse the URL from your script.
Description
•