统一控制延时
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
import type { MatchedFormField, UILibPickerConfig } from "./types"
|
||||
import { UI_LIB_PICKER_CONFIGS } from "./constants"
|
||||
import { delay } from "./autofill"
|
||||
import { delay } from "~utils/delay"
|
||||
|
||||
/** 通过提示文字判断是否为选择器 */
|
||||
function hasPickerHintText(field: MatchedFormField, lang: "zh" | "en"): boolean {
|
||||
@@ -109,7 +109,7 @@ async function dismissPopup() {
|
||||
document.activeElement.blur()
|
||||
}
|
||||
document.body.click()
|
||||
await delay(200)
|
||||
await delay("mid")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +142,7 @@ async function detectByClick(field: MatchedFormField): Promise<boolean> {
|
||||
for (const target of clickTargets) {
|
||||
const before = snapshotDOM()
|
||||
target.click()
|
||||
await delay(200)
|
||||
await delay("mid")
|
||||
|
||||
if (hasNewPopup(before)) {
|
||||
console.log(`OfferPie: [${field.key}] 点击 ${target.tagName}.${(target.className || "").toString().split(" ")[0]} 后检测到弹出层`)
|
||||
|
||||
Reference in New Issue
Block a user