|
@@ -1067,18 +1067,23 @@
|
|
|
if(['3','4','5'].indexOf(this.menuIndex) > -1){
|
|
|
redSize = '--window-size=1920,800'; //给浏览器一个初始大小,在无头模式下,页面会自适用缩放
|
|
|
}
|
|
|
- this[browserName] = await puppeteer.launch({
|
|
|
- headless: headless,
|
|
|
- executablePath: this.initPath(),
|
|
|
- userDataDir: userDataDir,
|
|
|
- args: [
|
|
|
- '--start-maximized',
|
|
|
- '--no-sandbox',
|
|
|
- '--disable-setuid-sandbox',
|
|
|
- '--disable-blink-features=AutomationControlled',
|
|
|
- redSize
|
|
|
- ]
|
|
|
- });
|
|
|
+
|
|
|
+ if(this[browserName] && this[browserName].isConnected()){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this[browserName] = await puppeteer.launch({
|
|
|
+ headless: headless,
|
|
|
+ executablePath: this.initPath(),
|
|
|
+ userDataDir: userDataDir,
|
|
|
+ args: [
|
|
|
+ '--start-maximized',
|
|
|
+ '--no-sandbox',
|
|
|
+ '--disable-setuid-sandbox',
|
|
|
+ '--disable-blink-features=AutomationControlled',
|
|
|
+ redSize
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
for(let i = 0; i < fileList.length; i++){
|
|
|
let item = fileList[i];
|
|
@@ -1147,8 +1152,14 @@
|
|
|
}
|
|
|
|
|
|
if(this[browserName]){
|
|
|
- this[browserName].close();
|
|
|
- this[browserName] = null;
|
|
|
+ //如果是前台显示模式就不关闭浏览器
|
|
|
+ let n1 = this.$utils.getStorage('exeType');
|
|
|
+ if(n1 && n1 == 2){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this[browserName].close();
|
|
|
+ this[browserName] = null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
this.loading = false;
|