Open prashantv opened 12 years ago
Can you explain what is going on? Interesting that one needs the hat (^), twice.
That looks like a Node.js bug, you might want to report it (e.g. by posting to the appropriate Node.js Google Group).
Yeah I wasn't sure if it was a Node.js bug or not, but the ^ character is the escape character for cmd. So by using exec, I know that it'll call cmd directly, and I can escape the URL directly. It runs the command passed to it in double quotes, so something like: cmd /c /s "[command]"
I want to pass it explorer.exe "url", but since the original command already has double quotes, I want to escape the double quotes, hence the ^.
I took a look at the node.js code to see if there was a bug, but couldn't really tell, do you think that the current way should definitely work?
I've just submitted a pull request that uses the "start" command (built inside cmd.exe) to launch the default browser, and should also fix this issue. I've tested it on the URL indicated by prashantv and it seems to work correctly.
This was never fixed? Ran into it today when trying to use this module..
No, I think this was never fixed. The pull request (https://github.com/rauschma/openurl/pull/3) I filed almost three years ago has never received any reply.
@jmc-88 cmd -c start
is the very better way
Can you merge and publish PR (https://github.com/rauschma/openurl/pull/3)? If you'd rather not maintain this anymore, can you transfer this to someone who will? (I'd be happy to)
Hi everyone, if anyone is still facing this problem, we published a fork to solve this problem as well: https://github.com/Interagierende-Systeme/openurl2
When trying to use openurl to open a link with equals, eg, "http://www.google.com/test=a", openurl ends up opening an explorer window instead of the browser.
I found a alternate way to open URLs with special characters in Windows that you may want to use instead: