Skip to content

Commit

Permalink
Rename parameter to forceHeadless
Browse files Browse the repository at this point in the history
  • Loading branch information
ElormCoch committed Jan 25, 2024
1 parent 94eb729 commit 807713c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,17 +390,17 @@ export async function getBrowserPath(config: Partial<IUserConfig> = {}): Promise
* @param port The port on which to enable remote debugging
* @param targetUrl The url of the page to open
* @param userDataDir The user data directory for the launched instance
* @param headleassOverride This overrides the --headless arg for browser launch
* @param forceHeadless This force overrides the --headless arg for browser launch
*/
export async function launchBrowser(browserPath: string, port: number, targetUrl: string, userDataDir?: string, headleassOverride?: boolean): Promise<puppeteer.Browser> {
export async function launchBrowser(browserPath: string, port: number, targetUrl: string, userDataDir?: string, forceHeadless?: boolean): Promise<puppeteer.Browser> {
const args = [
'--no-first-run',
'--no-default-browser-check',
`--remote-debugging-port=${port}`,
targetUrl,
];

const headless: boolean = headleassOverride ?? isHeadlessEnabled();
const headless: boolean = forceHeadless ?? isHeadlessEnabled();

let browserArgs: string[] = getBrowserArgs();
browserArgs = browserArgs.filter(arg => !arg.startsWith('--remote-debugging-port') && arg !== targetUrl);
Expand Down
1 change: 0 additions & 1 deletion test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ describe("extension", () => {
}));
});


it("can launch html files in non-remote contexts", async () => {
mockVSCode.env.remoteName = undefined;
const testFileUri = {
Expand Down

0 comments on commit 807713c

Please sign in to comment.