diff --git a/index.js b/index.js index 2586386..dfac576 100755 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ var fs = require('fs') var path = require('path') var isWsl = require('is-wsl') +var which = require('which') var { execSync } = require('child_process') var { StringDecoder } = require('string_decoder') @@ -18,6 +19,11 @@ var PREFS = [ 'user_pref("extensions.enabledScopes", 15);' ].join('\n') +// Check if Firefox is installed on the WSL side and use that if it's available +if (isWsl && which.sync('firefox', { nothrow: true })) { + isWsl = false +} + // Get all possible Program Files folders even on other drives // inspect the user's path to find other drives that may contain Program Files folders var getAllPrefixes = function () { diff --git a/package.json b/package.json index 0de8896..03124a6 100755 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "Žilvinas Urbonas " ], "dependencies": { - "is-wsl": "^2.1.1" + "is-wsl": "^2.1.1", + "which": "^2.0.1" } } diff --git a/yarn.lock b/yarn.lock index ac9931a..e468061 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3191,6 +3191,13 @@ which@^1.2.9: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.1.tgz#f1cf94d07a8e571b6ff006aeb91d0300c47ef0a4" + integrity sha512-N7GBZOTswtB9lkQBZA4+zAXrjEIWAUOB93AvzUiudRzRxhUdLURQ7D/gAIMY1gatT/LTbmbcv8SiYazy3eYB7w== + dependencies: + isexe "^2.0.0" + wide-align@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"