mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-08 05:04:40 +08:00
16 lines
327 B
JavaScript
16 lines
327 B
JavaScript
export function getPossibleElementByQuerySelector(queryArray) {
|
|
if (!queryArray) return
|
|
for (const query of queryArray) {
|
|
if (query) {
|
|
try {
|
|
const element = document.querySelector(query)
|
|
if (element) {
|
|
return element
|
|
}
|
|
} catch (e) {
|
|
/* empty */
|
|
}
|
|
}
|
|
}
|
|
}
|