Sending message, XPCOM object, that cannot be cloned

256 Views Asked by At

In this WebExtension, I'm trying to log all request urls in the background script, and send them in a message to the content script.

In the background script I add a listener:

browser.webRequest.onHeadersReceived.addListener(
  logURL,
  {urls: ["<all_urls>"]}
);

This listener used to work (for many months), and then paf, in the last few weeks, I get this error in MessageChannel.jsm:553:6:

Sending message that cannot be cloned. Are you trying to send an XPCOM object?

The function, logURL is never called. I suspect something has changed with firefox, and I'm behind the times. But then again, maybe intercepting the onHeadersReceived isn't the best way to log requests in the first place?

Is there a reason onHeadersReceived.addListener has stopped calling logURL?

0

There are 0 best solutions below