userScript's export() helper fails to export some common JS objects (Blobs, typed arrays, ...)
Categories
(WebExtensions :: General, defect, P3)
Tracking
(Not tracked)
People
(Reporter: robwu, Unassigned)
References
Details
Attachments
(1 obsolete file)
A user of the userScripts API reported that they wanted to transfer an object with a Blob and ArrayBuffer, but they were unable to do so: https://github.com/erosman/support/issues/96
Currently, only values that pass the following checks can be exported from an API script to a user script. In short, only primitive values, plain objects, functions, arrays, and objects with the page's principal can be exported at the moment.
Blobs, typed arrays and array buffers should also be safe to export. There are also other types that we should probably allow, to make script.export
a bit more useful, including the value types listed at:
https://searchfox.org/mozilla-central/rev/e3fc8f8970491aef14d3212b2d052942f4d29818/js/xpconnect/wrappers/XrayWrapper.cpp#81-102
Because of these limitations, the script.export
is not as useful as it could be, and extensions have to resort to using cloneInto
as a work-around.
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Comment hidden (off-topic) |
Comment 7•5 years ago
|
||
The priority flag is not set for this bug.
:jimm, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•5 years ago
|
Updated•2 years ago
|
Comment 8•10 months ago
|
||
The userScripts API this issue belongs to is the userScripts API namespace that was available only in Firefox manifest_version 2 extensions, that API namespace has been deprecated in manifest_version 3 extension where the same API namespace will be used for a different userScripts API shared with Chrome manifest_version 3 extensions (and also meant to be eventually supported by other vendors interested to support the use case that this API is meant to support).
Introducing support for the new MV3 API is tracked by Bug 1875475, but the part of the userScripts API this bug was related to is not part of what the new MV3 userScripts API namespace and so it does not fit into dependencies of Bug 1875475.
Given that this bug belongs to an API already on its deprecation path, I'm closing this as wontfix.
Description
•