Closed Bug 1389734 Opened 7 years ago Closed 3 years ago

Structured clone deserialize error when API call result is received after context is destroyed

Categories

(WebExtensions :: General, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: soeren.hentzschel, Assigned: robwu)

References

Details

Attachments

(1 file)

The following code causes an error in the console: browser.tabs.update({ url : 'about:blank' }); It works so there is no big problem but, of course, as WebExtension developer I want to avoid that my add-on causes any output in the console. The error is: TypeError: Argument 1 of StructuredCloneHolder.deserialize is not an object (ExtensionChild.jsm:784:24)
Summary: browser.tabs.update with about:blank as URL causes an error in console → Structured clone deserialize error when API call result is received after context is destroyed
Priority: -- → P3
Product: Toolkit → WebExtensions
Reproduction steps. 1. Load attached extension at about:debugging (or after unpacking, using web-ext run). 2. Visit http://example.com 3. Look at the global JS console. Depending on the timing, any of the following messages could be printed: Cannot send function call result: other side closed connection (call data: ({path:"storage.local.get", args:[null]})) Promise resolved while context is inactive contentscript.js:7 TypeError: Argument 1 of StructuredCloneHolder.deserialize is not an object. ExtensionChild.jsm:919:24 When the last error (this bug report) happens, then a memory leak occurs, because the listener is not cleaned up: https://searchfox.org/mozilla-central/rev/448f792f9652d29daebdad21bf50b03405e40a45/toolkit/components/extensions/ExtensionChild.jsm#961
Assignee: nobody → rob
Status: NEW → ASSIGNED

This deserialization error no longer happens. The logic is now at https://searchfox.org/mozilla-central/rev/4c06787a227b9f46ae22b70611f1213891d72e03/toolkit/components/extensions/ExtensionChild.jsm#794.

Previously, the error could occur if a message was received after destroying the context.
We've moved from a message-manager based communication to a JSWindowActor, and it's not possible to receive a message after destroying the context since the conduit is closed when the JSWindowActor is destroyed.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: