nodejs_chromium 1.1.20 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -4
- package/package.json +1 -1
- package/src/chrome.js +2 -1
package/index.js
CHANGED
|
@@ -14,7 +14,6 @@ global.__UA__ = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (K
|
|
|
14
14
|
const mob_ua = 'Mozilla/5.0 (Linux; Android 13;Build/TKQ1.220905.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36';
|
|
15
15
|
// const fs = require("fs");
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
async function NormalClose(path) {
|
|
19
18
|
/**
|
|
20
19
|
* 禁止显示【要恢复页面吗?chromium 未正确关闭。】
|
|
@@ -37,7 +36,6 @@ async function NormalClose(path) {
|
|
|
37
36
|
console.log(file, json.profile.exit_type)
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
|
|
41
39
|
async function newBrowser(params) {
|
|
42
40
|
try {
|
|
43
41
|
|
|
@@ -46,6 +44,7 @@ async function newBrowser(params) {
|
|
|
46
44
|
visible = false, //是否打开浏览器
|
|
47
45
|
width = 1024, //宽
|
|
48
46
|
height = 768, //高
|
|
47
|
+
maximized = 0, //最大化窗口,如果最大化,则宽高无效
|
|
49
48
|
scale = 1, //缩放比例
|
|
50
49
|
touch = false, //支持触摸
|
|
51
50
|
mobile = false, //手机版
|
|
@@ -104,6 +103,11 @@ async function newBrowser(params) {
|
|
|
104
103
|
]
|
|
105
104
|
}
|
|
106
105
|
|
|
106
|
+
if (maximized) {
|
|
107
|
+
option.defaultViewport = null;
|
|
108
|
+
option.args.push('--start-maximized');
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
if (proxy) option.args.push(`--proxy-server=${proxy}`);
|
|
108
112
|
if (incognito) option.args.push('--incognito', '--disable-infobars'); //使用无痕模式启动
|
|
109
113
|
if (!cache) option.args.push('--disable-cache'); //禁缓存
|
|
@@ -127,7 +131,6 @@ async function newBrowser(params) {
|
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
|
|
130
|
-
|
|
131
134
|
async function newChrome(params) {
|
|
132
135
|
try {
|
|
133
136
|
let {
|
|
@@ -207,5 +210,4 @@ async function checkInstall(install = false) {
|
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
|
|
210
|
-
|
|
211
213
|
export { newChrome, checkInstall }
|
package/package.json
CHANGED
package/src/chrome.js
CHANGED
|
@@ -698,7 +698,8 @@ export default class {
|
|
|
698
698
|
}, domain);
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
-
|
|
701
|
+
//'document',
|
|
702
|
+
skipTypes = ['image', 'font', 'other', 'script', 'stylesheet', 'ping'];
|
|
702
703
|
|
|
703
704
|
setSkipType(items) {
|
|
704
705
|
this.skipTypes.length = 0;
|