Hello,
My problem has to do with tracking down this annoying "Unchecked runtime.lastError" error message. It appears randomly, but only on the content script. The background scripts all have the errors detected and logged correctly, so I do not think it has to do with background scripts at all. It's company code, so I can't freely share the code to anyone.
I have done the following:
- Added if (chrome.runtime.lastError) console.error("(debug) ", chrome.runtime.lastError.message); everywhere to all functions where I do chrome.runtime.sendMessage and chrome.runtime.onMessage.addListener. Still can't successfully print out the message containing the substring, "(debug)", as this trick is how I would know the error has been found in the content scripts.
- Disabled all other extensions on the test browser (Chrome Canary, Chrome Dev, and Chrome Stable). Still getting this extension error, hinting that it's really the extension I'm working on that's causing the error.
I'm wondering what other causes I didn't know about that is making the "Unchecked runtime.lastError" error message popping up in the Console.
If any one know, let me know.
If Chrome or Chromium has a way to halt all asynchronous function calls when an exception or a runtime.lastError has been hit, that would be really awesome. But I know, this is a tall order and it's downright impossible to do. Just wishful thinking.