Skip to content

Commit

Permalink
DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Jan 4, 2025
1 parent 384f476 commit e6ac026
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,19 @@ const LocalBrowser = {
}
};

// - iterate from a Set to de-duplicate because `PROGRAMFILES`, and `ProgramW6432` are
// often "C:\Program Files" which, we'd otherwise check three times.
// - use filter() to remove empty entries.
//
// https://github.com/karma-runner/karma-chrome-launcher/blob/v3.2.0/index.js
// https://github.com/vweevers/win-detect-browsers/blob/v7.0.0/lib/browsers.js
const WINDOWS_DIRS = [
const WINDOWS_DIRS = new Set([
process.env.LOCALAPPDATA,
process.env.PROGRAMFILES,
process.env['PROGRAMFILES(X86)'],
process.env.ProgramW6432,
'C:\\Program Files'
].filter(Boolean);
].filter(Boolean));

function createFirefoxPrefsJs (prefs) {
let js = '';
Expand Down Expand Up @@ -259,6 +263,9 @@ async function firefox (url, signal, logger) {
}

async function chromium (paths, url, signal, logger) {
if (process.platform === 'win32') {
logger.debug('whatsinthere', WINDOWS_DIRS.slice());
}
const dataDir = LocalBrowser.makeTempDir();
// https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
const args = [
Expand Down

0 comments on commit e6ac026

Please sign in to comment.