microsoft / MicrosoftEdge-Extensions

This is a community space for Microsoft Edge Add-ons developers, to share resources and information about building, publishing and growing their Microsoft Edge extension.
MIT License
141 stars 128 forks source link

MS Edge crashes when user clicks a target="_blank" link in the sidepanel #145

Open twschiller opened 5 months ago

twschiller commented 5 months ago

We're hitting a nasty bug where MS Edge crashes when the user clicks a target=_blank URL in the sidepanel:

MS Edge crashes and on next startup, our extension is no longer installed

I'm surprised other developers haven't hit up against this? Or is there an existing bug ticket

We're currently trying to reliably intercept the clicks to use window.open or browser.tabs.create instead. However, in some cases there might be a frame embedded in the side panel. Therefore, we'd have to have a contentScript to just try to intercept link clicks for any frame that might appear within the sidepanel

mukul-p commented 5 months ago

Ack. We will get back after investigating this.

twschiller commented 5 months ago

Appreciate the help! For others viewing this issue, here's our latest workaround for embedded iframes: https://github.com/pixiebrix/pixiebrix-extension/pull/8223

rishikramena-ms commented 5 months ago

@twschiller can you share a sample extension for reproducing this crash? I tried reproducing the crash using the extension published on the Chrome Web Store but couldn't.

twschiller commented 5 months ago

Hi @rishikramena-ms, thanks for investigating. Here's a repository with a minimal reproduction: https://github.com/pixiebrix/msedge-crash-repro.

Let me know if there's any other information I can provide!

I think the bug is related to the sidebar being tab-specific. It wasn't crashing for me when using a global sidebar

It might also be related to MS Edge's behavior of closing the tab-specific sidebar when opening a new tab: https://github.com/w3c/webextensions/issues/588

I tried reproducing the crash using the extension published on the Chrome Web Store but couldn't.

We've added a mitigation: https://github.com/pixiebrix/pixiebrix-extension/blob/44a3b1a8b947ec82af349779c8e4baa4435db0ac/src/utils/openAllLinksInPopups.ts#L38-L38

And are also currently working on a mitigation for embedded frames using a content script: https://github.com/pixiebrix/pixiebrix-extension/pull/8223

twschiller commented 3 months ago

@rishikramena-ms any updates here? Do you need any additional information form us? This crashing bug is preventing our enterprise customers from using MS Edge with our product

rishikramena-ms commented 2 months ago

Hi @twschiller,

Sorry for the delayed resolution. We are aware of this issue and have identified a fix for this. This should be resolved in a subsequent update. Will notify you on this thread once the fix is available publicly.

Thanks, Rishik

rishikramena-ms commented 1 month ago

The fix is now available in canary.

apawson commented 1 month ago

In my case, adding rel="opener" to my links that also have target="_blank" seems to prevent the crash.