Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Did something change recently with how popup windows are handled on an extension reload?

152 views
Skip to first unread message

FW Extensions

unread,
Jan 3, 2025, 3:03:19 PMJan 3
to Chromium Extensions
My extension creates a popup window (distinct from the action popup) and keeps it around to show some UI.  Now in 131, when I reload the unpacked extension, I see the tab in the popup get replaced with the new tab contents, but the window is left open.  The screenshot below is after reloading the extension 5 times:

Multiple open popups.png

Is this intended behavior?  A bug?  I have code in the extension that closes any tabs that were left open after the restart, but it doesn't see those popups as connected to the extension at all, since they don't contain an extension tab.  A reload definitely used to close the popups, either because Chrome did it, or my code did, I'm not sure.

Dave Stewart

unread,
Jan 3, 2025, 6:05:31 PMJan 3
to Chromium Extensions, FW Extensions
I had the same issue. I just migrated from M2 to MV3, so suspect it might be MV3 related?

woxxom

unread,
Jan 3, 2025, 7:22:30 PMJan 3
to Chromium Extensions, Dave Stewart, FW Extensions
It was an unintentional consequence of fixing another bug. 

Evidently the new code doesn't handle the case of reloading an extension and confuses it with uninstalling, which is understandable as technically uninstalling is indeed a part of reloading. It also seems to incorrectly assume that the popup is the last window in the browser.

FWIW, it may be convenient for development in case the popup's state doesn't depend on a temporary variable but instead can be restored from storage or it's stateless, because I can simply press the GoBack hotkey in this popup to navigate back to the extension page without re-opening the popup.

FW Extensions

unread,
Jan 4, 2025, 3:28:26 PMJan 4
to Chromium Extensions, woxxom, Dave Stewart, FW Extensions
>  I just migrated from M2 to MV3, so suspect it might be MV3 related?

No, I had already migrated to MV3, and the popups were getting closed on reload before the last couple releases of Chrome.

>  I can simply press the GoBack hotkey in this popup to navigate back to the extension page without re-opening the popup.

Interesting.  I can go back to reload the extension page in the most recently opened popup, but if I've reloaded multiple times and there are several popups stacked up, the older ones seem to have no history.

Anyway, good to know I'm not going crazy...

woxxom

unread,
Jan 7, 2025, 11:30:33 AMJan 7
to Chromium Extensions, FW Extensions, woxxom, Dave Stewart
It was reported in https://crbug.com/379214836 and the fix will land soon in Canary. It's a trivial one-line fix, so hopefully it can be back-merged into an upcoming release.
Reply all
Reply to author
Forward
0 new messages