Rename to hkt.sh

This commit is contained in:
mango
2026-03-21 01:10:53 +08:00
parent 76a263d0f9
commit 8f1171fe99
6676 changed files with 1724268 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
const test = require('ava')
const { vanillaPuppeteer, addExtra } = require('../../test/util')
const Plugin = require('.')
const { argsToIgnore } = require('.')
test('vanilla: uses args to ignore', async t => {
const browser = await vanillaPuppeteer.launch({ headless: true })
const page = await browser.newPage()
const client =
typeof page._client === 'function' ? page._client() : page._client
const { arguments: launchArgs } = await client.send(
'Browser.getBrowserCommandLine'
)
const ok = argsToIgnore.every(arg => launchArgs.includes(arg))
if (!ok) {
console.log({ argsToIgnore, launchArgs })
}
t.is(ok, true)
})
test('stealth: does not use args to ignore', async t => {
const puppeteer = addExtra(vanillaPuppeteer).use(Plugin())
const browser = await puppeteer.launch({ headless: true })
const page = await browser.newPage()
const client =
typeof page._client === 'function' ? page._client() : page._client
const { arguments: launchArgs } = await client.send(
'Browser.getBrowserCommandLine'
)
const ok = argsToIgnore.every(arg => !launchArgs.includes(arg))
if (!ok) {
console.log({ argsToIgnore, launchArgs })
}
t.is(ok, true)
})