Skip to content
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

Closed
qwerasd205 opened this issue Aug 5, 2019 · 5 comments · Fixed by #10045
Closed

Support for data URLs and object URLs #2726

qwerasd205 opened this issue Aug 5, 2019 · 5 comments · Fixed by #10045
Labels
feat new feature (which has been agreed to/accepted)

Comments

@qwerasd205
Copy link
Contributor

qwerasd205 commented Aug 5, 2019

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:

@ry ry added the feat new feature (which has been agreed to/accepted) label Aug 5, 2019
@Fenzland
Copy link
Contributor

This feature also need for importing.
The follow codes work in browsers but dosn't in deno yet.

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.

@kitsonk
Copy link
Contributor

kitsonk commented Aug 18, 2019

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.

@Fenzland
Copy link
Contributor

Fenzland commented Sep 2, 2019

@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.

@dsseng
Copy link
Contributor

dsseng commented Nov 10, 2019

It can be implemented using https://docs.rs/data-url/0.1.0/data_url/

@EliteScientist
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants