-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for data URLs and object URLs #2726
Comments
This feature also need for importing. import value from 'data:application/javascript,export%20default%201%3B';
import (`data:application/javascript,${encodeURIComponent('export default 1;')}`).then(x=>console.log(x.default)); dynamic import with data-url is a good way to take place of eval(). So it's a essential feature. |
Here is the relevant discussion in Node.js: nodejs/node#28614. There are some security concerns with allowing this, but I guess the same applies for doing it with web workers. |
@kitsonk It does not bring new security problems. We can write the code to a file and import it to do the same thing. The only difference is slowness. An --allow-*** flag will be OK. |
It can be implemented using https://docs.rs/data-url/0.1.0/data_url/ |
My product is having the same issue. we need to dynamically create Workers and support dynamic imports from blob or object urls. I'm using 1.4.5 |
Data URLs and Object URLs (generally of blobs) are frequently used to dynamically create Workers -- support for these is missing in Deno which presents a compatibility issue with existing web code, and is an issue when trying to create workers from strings in Deno.
What's missing:
data:
scheme for URLsSupport for object URLs and(Solved by Implement Blob url support for worker #2729)URL.createObjectURL()
The text was updated successfully, but these errors were encountered: