mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-06-27 17:47:56 +08:00
15 lines
301 B
JavaScript
15 lines
301 B
JavaScript
export function getPossibleElementByQuerySelector(queryArray) {
|
|
for (const query of queryArray) {
|
|
if (query) {
|
|
try {
|
|
const element = document.querySelector(query)
|
|
if (element) {
|
|
return element
|
|
}
|
|
} catch (e) {
|
|
/* empty */
|
|
}
|
|
}
|
|
}
|
|
}
|