开始审核样式
This commit is contained in:
@@ -3,6 +3,7 @@ const path = require('path')
|
||||
|
||||
const [url, selector, output, width = '360', height = '800', action] = process.argv.slice(2)
|
||||
const renderSettleMilliseconds = 900
|
||||
const chromeDebuggingPort = process.env.CHROME_DEBUGGING_PORT || '9222'
|
||||
|
||||
if (!url || !selector || !output) {
|
||||
throw new Error('Usage: node scripts/capture-chrome-page.js <url> <selector> <output> [width] [height] [sms-tab|g06-results|g06-empty|fresh-navigation]')
|
||||
@@ -11,7 +12,7 @@ if (!url || !selector || !output) {
|
||||
const sleep = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds))
|
||||
|
||||
const connect = async () => {
|
||||
const pages = await (await fetch('http://127.0.0.1:9222/json/list')).json()
|
||||
const pages = await (await fetch(`http://127.0.0.1:${chromeDebuggingPort}/json/list`)).json()
|
||||
const page = pages.find((item) => item.type === 'page' && item.url.startsWith('http://localhost:5173'))
|
||||
if (!page) throw new Error('Chrome debugging has no localhost:5173 page')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user