How do you run playwright with already installed local firefox?
NOTE!: I need to be able to specify the executable as I'm actually developing firefox so I may have a custom build. But, step one is getting it to run with an official build.
I tried this
// test.mjs
import { firefox } from 'playwright-core';
const executablePath = "C:\\Program Files\\Mozilla Firefox\\firefox.exe";
async function main() {
const browser = await firefox.launch({
executablePath,
headless: false,
});
}
main();
but I get a bunch of errors
❯ node .\test.mjs
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
browserType.launch: Browser.enable): Browser closed.
==================== Browser output: ====================
<launching> C:\Program Files\Mozilla Firefox\firefox.exe -no-remote -wait-for-browser -foreground -profile C:\Users\gregg\AppData\Local\Temp\playwright_firefoxdev_profile-SMZBOF -juggler-pipe -silent
<launched> pid=10684
[pid=10684] <process did exit: exitCode=0, signal=null>
[pid=10684] starting temporary directories cleanup
=========================== logs ===========================
<launching> C:\Program Files\Mozilla Firefox\firefox.exe -no-remote -wait-for-browser -foreground -profile C:\Users\gregg\AppData\Local\Temp\playwright_firefoxdev_profile-SMZBOF -juggler-pipe -silent
<launched> pid=10684
[pid=10684] <process did exit: exitCode=0, signal=null>
[pid=10684] starting temporary directories cleanup
============================================================
at main (file:///C:/Users/gregg/src/gpuweb/cts/test.mjs:6:33)
at file:///C:/Users/gregg/src/gpuweb/cts/test.mjs:13:1 {
name: 'Error'
}
Tried MacOS as well as Window (of course on MacOS the path is different). This process works fine with Chrome