2017-12-14 1 views
-1

첫 번째 탭을 닫고 빈 탭을 남겨두기를 원합니다. 다음은 의미를 보여주는 그림입니다. untitled로컬 경로 인 크롬을 시작할 때 첫 번째 탭 닫기

여기에 내 코드

const fsExtra = require('fs-extra') 
const chromeLauncher = require('lighthouse/chrome-launcher/chrome-launcher'); 
const CDP = require('chrome-remote-interface'); 
const fs = require('fs'); 
const windowWidth = 6200; 
const windowHeight = 6060; 

headless=false 
const launchConfig = { 
    chromeFlags: [ 
     `--window-size=${windowWidth},${windowHeight}`, 
     '--disable-gpu', 
    headless ? '--headless' : '' 
    ] 
} 

async function launchChrome(headless = true) { 
    return await chromeLauncher.launch(launchConfig); 
} 

const chrome = launchChrome(); 
console.log(chrome) 

답변

0

문제는, headless:'' 거기 년대 launchConfig에 있었고, 그는 별도의 탭을 여는 동작이 발생할 무엇입니다.

따라서 해결책은 제거되고있다 :''

관련 문제