Simple WaitForKeyElement

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

Skrip ini tidak untuk dipasang secara langsung. Ini adalah pustaka skrip lain untuk disertakan dengan direktif meta // @require https://update.greatest.deepsurf.us/scripts/511024/1460585/Simple%20WaitForKeyElement.js

Penulis
1N07
Versi
1.0.1
Dibuat
01 Oktober 2024
Diperbarui
07 Oktober 2024
Size
962 Byte
Lisensi
Unlicense

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

Usage:

WaitForKeyElement(querySelectorString, optionalTimeoutInMilliseconds)

Example 1:

WaitForKeyElement('#someElement', 10000).then((foundElement) => {
  //do things with foundElement
});

Example 2:

//in async context*
const foundElement = await WaitForKeyElement('#someElement'));
//do things with foundElement