electerious / ackee-lighthouse

Send Lighthouse reports to Ackee.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add .env property to allow to set more Browser flags

matthiasbaldi opened this issue · comments

I used the tool locally and I missed the following feature to set a custom browser path:

const createReports = async (endpoint, headers, events, urls, audit) => {
    const additionalBrowserFlags = {};
    if (process.env.BROWSER_PATH)
        additionalBrowserFlags['chromePath'] = process.env.BROWSER_PATH;

    const browser = await chromeLauncher.launch({
        chromeFlags: ['--headless'],
        ...additionalBrowserFlags,
    });
    ...
}

.env file:

...
BROWSER_PATH=C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe
...

A such configuration would allow to test with multiple Chromium based browser like in my case Edge.
What do you think? Would that be a proper enhancement?

Sounds good 😊 A PR is welcome!