-1

I am new to chrome extension development. Sometimes I get the following errors:

  • Unchecked runtime.lastError: Cannot access a chrome:// URL
  • Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
  • Uncaught (in promise) TypeError: Cannot destructure property 'contentFullSize' of '(intermediate value)' as it is undefined.

1 Answers1

0

For the first error I replied to the same question here: Chrome Extension cause "Uncaught (in promise) Error: Cannot access a chrome:// URL"

Essentially, skip the tab if the URL is "chrome://":

if (tab.url?.startsWith("chrome://")) return undefined;

Note. To have access to tab.url you need "tabs" in manifest (V3) "permissions".

Alex 75
  • 2,798
  • 1
  • 31
  • 48