electerious/ackee-lighthouse

Add .env property to allow to set more Browser flags

Open

#10 建立於 2021年7月23日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)JavaScript (3 fork)github user discovery
help wanted

倉庫指標

Star
 (16 star)
PR 合併指標
 (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?

貢獻者指南