electerious/ackee-lighthouse

Add .env property to allow to set more Browser flags

オープン

#10 opened on 2021/07/23

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (3 件のフォーク)github user discovery
help wanted

Repository metrics

Stars
 (16 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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?

コントリビューターガイド