Repository navigation
Cross-thread URL.createObjectURL #46557
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.
on Feb 8, 2023 Yep, it would be good to see this updated.
This would solve quite many things
-
import(blobUrl) -
fetch(blobUrl) -
new Worker(blobUrl) - Reading the content of blob's in experimental loaders that do
import()things
But there are some other blockers atm that dose not even accept blob urls in
Workerorimport()in the first place - even if the blob urls was constructed in the same thread as the blob where createdThere needs to be some central location (aka blob store) where it can keep track of which blobs do exist and how to access them from basically anywhere.
-
Any way to work around this? What's the alternative way to do this instead of bloburl? Passing arraybuffers around?
github-actions commented
on Apr 19, 2024 on Apr 19, 2024 – with GitHub ActionsContributorMore actionsThere has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale
Issues and PRs exempt from automated stale handling. label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Apr 19, 2024 github-actions commented
on May 19, 2024 on May 19, 2024 – with GitHub ActionsContributorMore actionsThere has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
For more information on how the project manages feature requests, please consult the feature request management document.
What is the problem this feature will solve?
The blob url created with
URL.createObjectURLis not accessible from the other threads when usingbuffer.resolveObjectURL.The FileAPI defines that the blob url store is a per-agent setting: https://w3c.github.io/FileAPI/#url-model. A blob url created in the main thread should be accessible from the worker threads.
What is the feature you are proposing to solve the problem?
The blob url store should be shared across threads.
What alternatives have you considered?
This is explicitly documented as https://nodejs.org/api/url.html#urlcreateobjecturlblob:
We can keep this as is without the spec compliance.