Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port.onDisconnect is not fired when connection is broken #40

Open
g-sam opened this issue Sep 7, 2023 · 1 comment
Open

port.onDisconnect is not fired when connection is broken #40

g-sam opened this issue Sep 7, 2023 · 1 comment

Comments

@g-sam
Copy link

g-sam commented Sep 7, 2023

browser.runtime.connect port object's onDisconnect event should be fired when a connected tab is closed and in various other circumstances, but isn't. It may work when port.disconnect() is called explicitly (haven't tested).

I found a few other reports of this issue:

The following may be a related bug or simply divergent behaviour: in Chrome, port.postMessage() on a disconnected port throws an error. In Safari, it does nothing.

@xeenon
Copy link

xeenon commented Apr 11, 2024

It would be good to retry this on Safari Technology Preview 192, which uses WebKit's version of Web Extensions. Ports specifically have been rewritten there, and an error is thrown if the port is disconnected. There are a couple tests for onDisconnect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants