How to Fix: Could not establish connection. Receiving end does not exist
If you are developing a Chrome extension with message passing, then you might have received the following error: Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.. There was some type of behavior change that happened post Chrome 72 that affected the way channels are opened. Essentially, if you try to call runetime.connect() before you have a a channel open, then you will get this error (Stackoverflow).
How to build a Chrome Extension
What we’re building We are going to build a simple chrome extension that will allow you to search google for any text that you highlight on a page.