MCPcopy Index your code
hub / github.com/darkreader/darkreader / getChromePath

Function getChromePath

tests/browser/paths.js:39–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 * @returns {Promise<string>}
38 */
39export async function getChromePath() {
40 if (process.platform === 'darwin') {
41 return '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
42 }
43 if (process.platform === 'win32') {
44 return winProgramFiles('Google\\Chrome\\Application\\chrome.exe');
45 }
46 const possibleLinuxPaths = ['google-chrome', 'google-chrome-stable', 'chromium'];
47 for (const possiblePath of possibleLinuxPaths) {
48 try {
49 return await linuxAppPath(possiblePath);
50 } catch (e) {
51 // ignore
52 }
53 }
54 throw new Error('Could not find Chrome');
55}
56
57/**
58 * @returns {Promise<string>}

Callers 1

launchChromeMethod · 0.90

Calls 2

winProgramFilesFunction · 0.85
linuxAppPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…