I’ve also seen this error recently and I was also surprised why I didn’t noticed the issue before…
So maybe something did changed.
Anyway, in my case I was sending object that contained a Promise, which caused the issue. But there are other un-clonable types as well.
Simple fix could look like this:
JSON.parse(JSON.stringify(data))
I’m trying to find more info, but the docs are confusing.
For runtime.sendMessage it says the message is “An object that can be structured clone serialized.”.
For tabs.sendMessage it says the message is “An object that can be serialized to JSON.”.
It seems that passing undefined for a variable doesn’t work anymore and you have to pass something else (for example {}) instead:
browser.runtime.sendMessage({ data: data ?? {} });
Which is weird change that isn’t mentioned anywhere.
Still having a lot of other weird issues with sendMessage after changing to this code
sendRemoveListener on closed conduit ConduitsChild.jsm:108
Promise resolved after context unloaded
Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
What exactly is not working? Do you get the clone error?
Regarding the “Receiving end does not exist”, this happens when you send message somewhere, expecting a reply but there is no receiver registered which could reply.
This can happen if you for example create new tab and send there a message, but the tab is not yet fully loaded so you get this error.
I know what the error means, but this flow works perfectly in Firefox 78.x and Chrome, so the update introduced some changes as to how messaging works.
I’m not getting a clone error after the aforementioned changes in code.
@R4d1z, could you provide the link to your extension and the steps to reproduce the issue, either here or on the bug? That will help us speed up the investigation.
Hi I’ve just made a new post on exactly this subject went to ff79.0& everything just fell apart. No pages would load as kept getting the you are either not on the internet or the certificates are expired(which has me ready to go to the new edge or chrome as I can’t be without pages for days)anyway I got it working again by uninstalling79.0 then reinstalling it from Mozilla site just when it tells you it will probably be best for a fresh install I pressed no(after trying yes&getting nowhere)&it came back on with all extentions working &all bookmarks back. Could be a fluke but I never had1bit of trouble in the UK last year when FF was getting verbally battered by all it’s US users(as it should)then touchwood all been good for4days now,but I will not have it go off again IL be off to greener pastures