Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auto-chrome

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-chrome - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

2

lib/Element.js

@@ -252,4 +252,2 @@ const { sleep, signale } = require('./helper');

await this.focus()
await sleep(600)

@@ -256,0 +254,0 @@

36

lib/Page.js

@@ -118,15 +118,2 @@ const Message = require('./Message');

/**
* 聚焦input元素
* @param {*} selector
*/
async focus(selector) {
let element = await this.$(selector)
if (element) {
await element.focus()
return element
}
}
/**
* 通过选择器获取元素坐标

@@ -235,6 +222,23 @@ * @param {String} selector CSS选择器

/**
* 聚焦input元素
* @param {String} selector
*/
async focus(selector) {
let element = await this.$(selector)
if (element) {
await element.focus()
return element
}
}
/**
* 键盘入
* @param {*} selector CSS选择器
* @param {*} text 输入文本
* @param {*} options 附加选项
* @param {String} selector CSS选择器
* @param {String} text 输入文本
* @param {Object} options 附加选项
*/

@@ -241,0 +245,0 @@ async type(selector, text, options) {

{
"name": "auto-chrome",
"version": "0.2.5",
"version": "0.2.6",
"description": "使用Node.js操作Chrome或Chromium,高仿真的用户行为模拟器",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -14,11 +14,17 @@ const autoChrome = require('../..')

await chrome.page.goto('http://www.runoob.com/')
let page = chrome.page
await sleep(3000)
await page.goto('http://www.runoob.com/')
await chrome.page.type('.search-desktop .placeholder', 'hellow word')
await sleep(1000)
let input = await page.$('.search-desktop .placeholder')
await input.focus()
await input.type('hellow word')
await sleep(500)
await chrome.keyboard.press("Enter")
await page.keyboard.press("Enter")

@@ -25,0 +31,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc