auto-chrome
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -22,5 +22,6 @@ "use strict"; | ||
const { ignoreHTTPSErrors, emulate } = options; | ||
const { ignoreHTTPSErrors, emulate, disableDownload } = options; | ||
this.ignoreHTTPSErrors = ignoreHTTPSErrors; | ||
this.disableDownload = disableDownload; | ||
this.emulate = emulate; | ||
@@ -125,3 +126,5 @@ | ||
// 返回错位消息时,强制退出chrome进程 | ||
console.log(data) | ||
// 返回错误消息时,强制退出chrome进程 | ||
if (data.error) { | ||
@@ -128,0 +131,0 @@ |
@@ -37,3 +37,7 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
this.callbacks.set(id, { resolve, reject, method }); | ||
this.callbacks.set(id, { | ||
resolve, | ||
reject, | ||
method | ||
}); | ||
timechain.set(reject, `${method}消息超时`); | ||
@@ -230,2 +234,8 @@ }).catch(error => { | ||
if (this.disableDownload === true) { | ||
list.push(page.send('Page.setDownloadBehavior', { | ||
"behavior": "deny" | ||
})); | ||
} | ||
await Promise.all(list); | ||
@@ -232,0 +242,0 @@ |
@@ -187,2 +187,2 @@ "use strict" | ||
module.exports = PageEvent | ||
module.exports = PageEvent; |
{ | ||
"name": "auto-chrome", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "使用Node.js操作Chrome或Chromium,高仿真的用户行为模拟器", | ||
@@ -5,0 +5,0 @@ "main": "lib/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84142
1991