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

Solve "Error: Could not establish connection. Receiving end does not exist." #2156

Open
melink14 opened this issue Aug 18, 2024 · 1 comment
Labels
Code health Issues which if fixed would improve the health of the project (as opposed to new features/bugs)

Comments

@melink14
Copy link
Owner

melink14 commented Aug 18, 2024

In MV3, this error comes up in various contexts. It seems harmless but as noise it would be good to minimize it. It mostly happens in the onActivated listener as far as I can tell.

  1. When trying to activate on chrome:// tabs.
  2. When trying to activate tabs that existed before the current version of the extension was installed. (this is tracked at Doesn't work on existing tabs when enabled immediately after install or update #36)

The former could be fixed with a check in the handler, the latter probably needs to be solved as part of a larger fix of handling stale tabs when the extension is updated.

@melink14 melink14 added the Code health Issues which if fixed would improve the health of the project (as opposed to new features/bugs) label Aug 18, 2024
@melink14 melink14 changed the title Solve "Error: Could not establish connection. Receivign end does not exist." Solve "Error: Could not establish connection. Receiving end does not exist." Aug 18, 2024
@melink14
Copy link
Owner Author

From https://stackoverflow.com/questions/10994324/chrome-extension-content-script-re-injection-after-upgrade-or-install there is an example regex:

if (tab.url.match(/(chrome|chrome-extension):\/\//gi)) {
        continue;
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code health Issues which if fixed would improve the health of the project (as opposed to new features/bugs)
Projects
None yet
Development

No branches or pull requests

1 participant