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

Open local file with URL parameter #48

Open
mm-gmbd opened this issue Dec 9, 2015 · 0 comments
Open

Open local file with URL parameter #48

mm-gmbd opened this issue Dec 9, 2015 · 0 comments

Comments

@mm-gmbd
Copy link

mm-gmbd commented Dec 9, 2015

First, thanks for this package!

I'm trying to open a local page (not even served with a local server, just served by the filesystem itself) and supply a URL parameter, but I'm getting an error message.

Example:

var open = require('open');
open('./a/local/file.html?param=hello');

image

I'm guessing it interprets the entirety of the string as the filename.

Interestingly, if I pass chrome as the second argument, it successfully opens chrome, but it just uses the url ./a/local/file.html?param=hello directly rather than adding the path to the file (as it does without the url parameter).

My current workaround is to prepend __dirname to the path, but I still have to supply the second argument:

open(__dirname+'/a/local/file.html?param=hello', 'chrome');

Out-of-the-box support for this (without having to specify the secondary argument) would be nice :)

Thanks,
-Max

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

1 participant