auto-chrome
Advanced tools
Comparing version 0.4.7 to 0.4.8
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
const childProcess = require('child_process') | ||
@@ -2,0 +4,0 @@ const readline = require('readline'); |
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
const Event = require('./Event'); | ||
@@ -2,0 +4,0 @@ const { logger, zPromise } = require('./helper'); |
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
const { sleep, logger } = require('./helper'); | ||
@@ -2,0 +4,0 @@ |
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
const EventEmitter = require('events'); | ||
@@ -9,3 +11,3 @@ const debug = require('debug'); | ||
const { logger, zPromise } = require('./helper'); | ||
const { logger, timechain } = require('./helper'); | ||
@@ -38,3 +40,4 @@ class Event extends EventEmitter { | ||
return new Promise((resolve, reject) => { | ||
this.callbacks.set(id, { resolve, reject, method }); | ||
this.callbacks.set(id, { resolve, reject, method }) | ||
timechain.set(reject, '等待消息返回超时') | ||
}).catch(error => { | ||
@@ -59,2 +62,3 @@ logger.error(id, new Error(error.message)) | ||
if (callback) { | ||
timechain.delete(callback.reject) | ||
this.callbacks.delete(object.id); | ||
@@ -61,0 +65,0 @@ if (object.error) { |
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
const logger = require('loggercc') | ||
@@ -2,0 +4,0 @@ const timeChain = require('timechain') |
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
const { assert, sleep } = require('./helper'); | ||
@@ -2,0 +4,0 @@ const keyDefinitions = require('./USKeyboard'); |
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
const debug = require('debug'); | ||
@@ -32,4 +34,4 @@ const { logger, zPromise, timechain } = require('./helper'); | ||
return new Promise((resolve, reject) => { | ||
this.callbacks.set(id, { resolve, reject, method }); | ||
timechain.set(reject, '等待ws返回消息超时') | ||
this.callbacks.set(id, { resolve, reject, method }) | ||
timechain.set(reject, '等待session消息返回超时') | ||
}).catch(error => { | ||
@@ -55,7 +57,7 @@ if (error instanceof Object) { | ||
timechain.delete(callback.reject) | ||
this.callbacks.delete(message.id); | ||
this.callbacks.delete(message.id) | ||
if (message.error) { | ||
callback.reject(message.error) | ||
} else { | ||
callback.resolve(message.result); | ||
callback.resolve(message.result) | ||
} | ||
@@ -62,0 +64,0 @@ } |
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
class Network { | ||
@@ -2,0 +4,0 @@ |
@@ -0,1 +1,3 @@ | ||
"use strict" | ||
const Message = require('./Message'); | ||
@@ -2,0 +4,0 @@ const Element = require('./Element'); |
{ | ||
"name": "auto-chrome", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"description": "使用Node.js操作Chrome或Chromium,高仿真的用户行为模拟器", | ||
@@ -14,6 +14,6 @@ "main": "index.js", | ||
"debug": "^3.1.0", | ||
"loggercc": "^1.2.4", | ||
"timechain": "^1.1.2", | ||
"loggercc": "^1.2.9", | ||
"timechain": "^1.2.0", | ||
"ws": "^6.0.0", | ||
"zpromise": "^1.2.0" | ||
"zpromise": "^1.2.2" | ||
}, | ||
@@ -20,0 +20,0 @@ "directories": { |
@@ -28,4 +28,2 @@ const autoChrome = require('../../') | ||
console.log(key) | ||
let element = elements[key] | ||
@@ -55,4 +53,2 @@ | ||
console.log(data) | ||
await sleep(2000) | ||
@@ -59,0 +55,0 @@ |
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
570079
2851
Updatedloggercc@^1.2.9
Updatedtimechain@^1.2.0
Updatedzpromise@^1.2.2