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

onDisconnect don`t work in Safari extension #299

Open
SkipTyler opened this issue Mar 31, 2021 · 1 comment
Open

onDisconnect don`t work in Safari extension #299

SkipTyler opened this issue Mar 31, 2021 · 1 comment

Comments

@SkipTyler
Copy link

Hello,
does not respond to popup closing in onDisconnect

Code:

const browser = require("webextension-polyfill");
browser.runtime.onConnect.addListener((event: any) => {
  event.onDisconnect.addListener(async () => {
    console.log("disconnect")
  });
});
@rpl
Copy link
Member

rpl commented Apr 13, 2021

@SkipTyler if I recall correctly Safari does provide a browser global (which is basically an alias of the chrome global) which provide their own natively implemented promise-based extensions API. Given that browser global is already defined in Safari as it is in Firefox I would expect that the polyfill does turn itself into a no-op on Safari and so this issue is more likely an issue with Safari implementation and invalid from a polyfill perspective.

I would suggest to try to reproduce the same issue with a minimal test extension that doesn't even include the polyfill, to double-check that you can still reproduce the issue (as I would expect based on what described above), and then report the issue to Safari if you are able to still trigger the issue.

If instead you get some more details that shows that the polyfill is actually wrapping the chrome namespace in Safari (which would be unexpected), then feel free to comment here and mention me in that comment, we may take a look when possible (but it isn't something that will be considered a critical issue, technically we do not support Safari yet in this polyfill and we were not planning to because Safari does already provide a promise-based API and so we may just double-check why the polyfill doesn't turn itself into a no-op as it should).

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

No branches or pull requests

2 participants