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 importing data URLs #5059

Closed
kitsonk opened this issue May 3, 2020 · 5 comments · Fixed by #5157
Closed

Support importing data URLs #5059

kitsonk opened this issue May 3, 2020 · 5 comments · Fixed by #5157
Assignees
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)

Comments

@kitsonk
Copy link
Contributor

kitsonk commented May 3, 2020

As pointed out in #5048, we should consider importing data URLs. The following works in Chromium:

await import("data:application/javascript;charset=utf-8;base64,Y29uc29sZS5sb2coImhlbGxvIHdvcmxkIik7");

Which which then will log hello world to the console.

@Fenzland
Copy link
Contributor

base64 is additional feature, the basic usage is

import('data:application/javascript,'+encodeURIComponent('console.log(3);'));

@Lonniebiz
Copy link

Lonniebiz commented May 13, 2020

Firefox supports this too:
ffDate
Interesting that it returns an intermediary symbol object before resolving Hello World. Well, since it is imported, I guess it is indeed a module.

@bartlomieju bartlomieju added cli related to cli/ dir feat new feature (which has been agreed to/accepted) labels May 21, 2020
@kitsonk kitsonk reopened this Oct 18, 2020
@nayeemrmn
Copy link
Collaborator

One of this and #7433 can be closed.

@kitsonk
Copy link
Contributor Author

kitsonk commented Oct 24, 2020

How so, what PR was this landed in?

@nayeemrmn
Copy link
Collaborator

I mean they're duplicates and one can be closed.

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

Successfully merging a pull request may close this issue.

5 participants