()
| 79 | * @returns {Promise<string>} |
| 80 | */ |
| 81 | export async function getFirefoxPath() { |
| 82 | if (process.platform === 'darwin') { |
| 83 | return '/Applications/Firefox Nightly.app/Contents/MacOS/firefox'; |
| 84 | } |
| 85 | if (process.platform === 'win32') { |
| 86 | return await winProgramFiles('Firefox Nightly\\firefox.exe'); |
| 87 | } |
| 88 | const possibleLinuxPaths = ['firefox-nightly', 'firefox']; |
| 89 | for (const possiblePath of possibleLinuxPaths) { |
| 90 | try { |
| 91 | // snap profile folders do not get loaded |
| 92 | const option = await linuxAppPath(possiblePath); |
| 93 | // Firefox snap can not access the regular system-wide temporary directory, |
| 94 | // so we create a separate one within build folder |
| 95 | // See also: https://github.com/mozilla/web-ext/issues/1696 |
| 96 | if (!option.includes('/snap/')) { |
| 97 | return option; |
| 98 | } |
| 99 | const firefoxProfile = './build/firefox-profile-for-testing'; |
| 100 | process.env.TMPDIR = firefoxProfile; |
| 101 | try { |
| 102 | fs.mkdirSync(firefoxProfile); |
| 103 | } catch (e) { |
| 104 | // Do nothing |
| 105 | } |
| 106 | return option; |
| 107 | } catch (e) { |
| 108 | // ignore |
| 109 | } |
| 110 | } |
| 111 | throw new Error('Could not find firefox-nightly'); |
| 112 | } |
| 113 | |
| 114 | export const chromeExtensionDebugDir = path.join(__dirname, '../../build/debug/chrome'); |
| 115 | export const chromePlusExtensionDebugDir = path.join(__dirname, '../../build/debug/chrome-plus'); |
no test coverage detected
searching dependent graphs…