Skip to content

Instantly share code, notes, and snippets.

View double-beep's full-sized avatar
🏠
Working from home

double beep double-beep

🏠
Working from home
View GitHub Profile
@double-beep
double-beep / waitForKeyElements.js
Last active March 9, 2025 17:00 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/* waitForKeyElements(): The improved utility function for userscripts - now with MutationObservers and no jQuery!
Usage example:
waitForKeyElements(
'div.comments',
element => console.log('Look! A new element appeared!', element)
);
// -----------------------------------------------------------------