From eec5065fbd37973d6de03cbc1fc9dcbe4e7511f5 Mon Sep 17 00:00:00 2001 From: jgieryluk Date: Mon, 23 Mar 2015 09:08:51 +0100 Subject: [PATCH] Fix Windows issue with ampersand in the URLs close #9 close #12 --- opener.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opener.js b/opener.js index 3f95d06..8951fa2 100644 --- a/opener.js +++ b/opener.js @@ -35,6 +35,11 @@ function opener(args, options, callback) { // // Furthermore, if "cmd /c" double-quoted the first parameter, then "start" will interpret it as a window title, // so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191 + // + // Additionally, on Windows ampersand needs to be escaped when passed to "start" + args = args.map(function(value) { + return value.replace(/&/g, '^&'); + }); args = ["/c", "start", '""'].concat(args); }