auto-chrome
Advanced tools
Comparing version 0.3.7 to 0.3.8
@@ -10,3 +10,3 @@ const Event = require('./Event'); | ||
*/ | ||
constructor(ws, ignoreHTTPSErrors = true, emulate = {}) { | ||
constructor(ws, ignoreHTTPSErrors = true, emulate) { | ||
@@ -68,3 +68,3 @@ super() | ||
return this.send('Target.closeTarget', { targetId }) | ||
return await this.send('Target.closeTarget', { targetId }) | ||
@@ -71,0 +71,0 @@ } |
@@ -129,2 +129,3 @@ const EventEmitter = require('events'); | ||
// 忽略https错误 | ||
if (this.ignoreHTTPSErrors) { | ||
@@ -131,0 +132,0 @@ await this.page.send('Security.enable') |
@@ -35,4 +35,4 @@ const debug = require('debug'); | ||
if (error.code) { | ||
let { code, message, data } = error | ||
signale.error(code, new Error(`${message} ${data}`)) | ||
let { message, data } = error | ||
signale.error(new Error(`${method} ${message} ${data}`)) | ||
} else { | ||
@@ -48,2 +48,3 @@ signale.error(new Error(Object.values(error).toString())) | ||
'Target.receivedMessageFromTarget'(message) { | ||
message = JSON.parse(message) | ||
@@ -65,2 +66,3 @@ if (message.id) { | ||
} | ||
} | ||
@@ -73,2 +75,3 @@ /** | ||
this.contextId = context.id | ||
this.document.objectId = null | ||
} | ||
@@ -135,3 +138,3 @@ } | ||
} | ||
} | ||
@@ -138,0 +141,0 @@ /** |
@@ -26,3 +26,3 @@ const Message = require('./Message'); | ||
*/ | ||
async emulate(options) { | ||
async emulate(options = {}) { | ||
@@ -166,3 +166,3 @@ let { hasTouch, geolocation = {}, ...emulate } = options | ||
/** | ||
* 滚动元素至指定元素 | ||
* 滚动网页至指定元素 | ||
* @param {String} selector | ||
@@ -169,0 +169,0 @@ */ |
{ | ||
"name": "auto-chrome", | ||
"version": "0.3.7", | ||
"version": "0.3.8", | ||
"description": "使用Node.js操作Chrome或Chromium,高仿真的用户行为模拟器", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
569217
2843