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 data URI #24

Closed
sonnyp opened this issue Jan 21, 2016 · 11 comments
Closed

Support data URI #24

sonnyp opened this issue Jan 21, 2016 · 11 comments

Comments

@sonnyp
Copy link

sonnyp commented Jan 21, 2016

opn data:,Hello%2C%20World!

should open the data URI in the browser but does nothing (OS X)

@sindresorhus
Copy link
Owner

Neither does the builtin open:

❯ open data:,Hello%2C%20World!
The file /Users/sindresorhus/data:,Hello%2C%20World! does not exist.

@sonnyp
Copy link
Author

sonnyp commented Jan 21, 2016

So it doesn't enter within the scope of opn?

@sonnyp
Copy link
Author

sonnyp commented Jan 21, 2016

somehow missed

Uses the command open on OS X, start on Windows and xdg-open on other platforms.

from https://github.com/sindresorhus/opn#api

@sonnyp sonnyp closed this as completed Jan 21, 2016
@sindresorhus
Copy link
Owner

It will probably work if you explicitly specify a browser in the app option.

@sindresorhus
Copy link
Owner

You could also probably hack support for it by detecting a data URI and writing the contents to a tempfile, then open that file.

@sonnyp
Copy link
Author

sonnyp commented Jan 21, 2016

@sindresorhus so I take you'd accept a PR?

@sonnyp sonnyp reopened this Jan 21, 2016
@sindresorhus
Copy link
Owner

Hmm, not sure. Why do you need it? What are you using it for?

@sonnyp
Copy link
Author

sonnyp commented Jan 21, 2016

@sindresorhus I'd use it with pipe, when playing with buffers that contain image data it's quite useful

./myscript | opn

@sonnyp
Copy link
Author

sonnyp commented Jan 21, 2016

I don't think it's of much usefulness to most users though, I could simply write an ori Open URI cli that uses opn and a temporary file as you suggested

@sindresorhus
Copy link
Owner

I think it would be useful for https://github.com/sindresorhus/opn-cli. PR welcome to add stdin support there using https://github.com/sindresorhus/get-stdin and https://github.com/sindresorhus/temp-write.

@sonnyp
Copy link
Author

sonnyp commented Jan 22, 2016

sindresorhus/open-cli#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants