Bug 1383076 - restore workaround for 'current' setter on panelviews in non-photon panelmultiview, r?mconley
MozReview-Commit-ID: 6YZ6Wyu0Spc
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -176,16 +176,22 @@ this.browserAction = class extends Exten
let popupURL = this.getProperty(tab, "popup");
this.tabManager.addActiveTabPermission(tab);
// Popups are shown only if a popup URL is defined; otherwise
// a "click" event is dispatched. This is done for compatibility with the
// Google Chrome onClicked extension API.
if (popupURL) {
try {
+ if (event.target.closest("panelmultiview")) {
+ // FIXME: The line below needs to change eventually, but for now:
+ // ensure the view is _always_ visible _before_ `popup.attach()` is
+ // called. PanelMultiView.jsm dictates different behavior.
+ event.target.setAttribute("current", true);
+ }
let popup = this.getPopup(document.defaultView, popupURL);
let attachPromise = popup.attach(event.target);
event.detail.addBlocker(attachPromise);
await attachPromise;
TelemetryStopwatch.finish(POPUP_OPEN_MS_HISTOGRAM, this);
if (this.eventQueue.length) {
let histogram = Services.telemetry.getHistogramById(POPUP_RESULT_HISTOGRAM);
histogram.add("popupShown");