chore: code formatting
This commit is contained in:
@@ -25,10 +25,10 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
|||||||
//Screenshot
|
//Screenshot
|
||||||
let content = null
|
let content = null
|
||||||
let image = null
|
let image = null
|
||||||
const metadata = {height:null, width:null}
|
const metadata = {height: null, width: null}
|
||||||
await page.waitForSelector(selector)
|
await page.waitForSelector(selector)
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case "image":{
|
case "image": {
|
||||||
const clip = await page.evaluate(selector => {
|
const clip = await page.evaluate(selector => {
|
||||||
const {x, y, width, height} = document.querySelector(selector).getBoundingClientRect()
|
const {x, y, width, height} = document.querySelector(selector).getBoundingClientRect()
|
||||||
return {x, y, width, height}
|
return {x, y, width, height}
|
||||||
@@ -40,7 +40,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
|||||||
Object.assign(metadata, await screenshot.metadata())
|
Object.assign(metadata, await screenshot.metadata())
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case "text":{
|
case "text": {
|
||||||
content = await page.evaluate(selector => document.querySelector(selector)?.innerText ?? "", selector)
|
content = await page.evaluate(selector => document.querySelector(selector)?.innerText ?? "", selector)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user