Library that Exports my simplified vanilla JS version of WaitForKeyElement, which is a simple async function that returns a Promise that resolves to an element by a given selector, when that element is found
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/511024/1460585/Simple%20WaitForKeyElement.js
WaitForKeyElement(querySelectorString, optionalTimeoutInMilliseconds)
WaitForKeyElement('#someElement', 10000).then((foundElement) => {
//do things with foundElement
});
//in async context*
const foundElement = await WaitForKeyElement('#someElement'));
//do things with foundElement