question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Could not establish connection. Receiving end does not exist." when doing a search

See original GitHub issue

I’m opening this issue because:

  • I’ll report a bug

Description

Sometimes, when using the search functionality (type “/”, type search terms, press Enter), a message in red is displayed at the bottom of the browser window: “Could not establish connection. Receiving end does not exist.”. The search functionality does not work.

Steps to Reproduce

I don’t know how to reproduce the issue systematically. It seems to occur more often on some pages. On pages where it sometimes does not work, it sometimes works also. Reloading the page does not seem to help. Opening another tab and searching for some text which is already visible in the window and then going back to the tab where the error occurred seems to help sometimes (repeating the search works at that point).

System configuration

  • Operating system: Debian GNU/Linux 11 (bullseye)
  • Firefox version: 88.0.1 (64-bit)
  • Vim-Vixen version: 1.2.2

Console logs

Any relevant log in developer tools: No message when the problem occurs.

When using the workaround described above (doing a search in another tab), after going back to the tab where the search did not work, the following message is repeated a few times with different “window frame” numbers:

Failed to add shortcut on window frame 17: SecurityError: Permission denied to access property "addEventListener" on cross-origin object
shortcut.js:214:14
moz-extension://87eef6e0-d9bf-48f8-b84d-19befd6cff31/shortcut.js

I guess this message is related to vim-vixen.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:14
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
SkyLeachcommented, Feb 11, 2022

This has become the bane of my existence because it comes up all the time and when it comes up both Vim-Vixen and find+ (regex) break and quite possibly for the same reason: the missing promise.

This issue seems to have a really good explanation of the problem and solution on stackoverflow:

https://stackoverflow.com/questions/41624852/messaging-problems-between-content-script-and-background-script-webextensions

And, since it’s such a PITA and waste of productivity it got me investigating it (even though I really don’t have time) and looking at the use of simple wildcards instead of real vim regex.

I wonder if it might be possible to combine the fix for this and Find+ to have real search/substitute with vim-style regex in the browser? It’s there in javascript, there is an existing extension that could be partnered with to provide it, can we please explore combining them?

Also, I really don’t think this should have been closed so quickly. It’s really not fixed.

4reactions
jakkdlcommented, Jul 27, 2022

+1 to SkyLeach, it happens to me regularly. Could this issue please be reopened?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not establish connection. Receiving end does not exist ...
For sendMessage case, it happens because you might have not setup ( or mistakenly removed ) the corresponding onMessage listener in the background...
Read more >
How to stop "Could not establish connection. Receiving end ...
The only issue/improvement is I don't want the " Could not establish connection. Receiving end does not exist." error message to be logged...
Read more >
Chrome Extension “Receiving end does not exist.”
Make sure your background/content scripts are updated, loaded (reloaded) and available to each other at the very same moment you're trying to ...
Read more >
How to Fix: Could not establish connection. Receiving end ...
If you are developing a Chrome extension with message passing, then you might have received the following error: Unchecked runtime.
Read more >
[AskJS] Could not establish connection? (Chrome extension)
I am trying to send a message from my background.js file to the content.js file. The error printed to the extension console is:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found