Skip to content

Instantly share code, notes, and snippets.

@RuioWolf
RuioWolf / waitForKeyElements.js
Created August 13, 2020 16:35 — forked from mjblay/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content. Forked for use without JQuery.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
//--- Page-specific function to do what we want when the node is found.
function commentCallbackFunction (element) {
element.text ("This comment changed by waitForKeyElements().");

Keybase proof

I hereby claim:

  • I am RuioWolf on github.
  • I am ruiowolf (https://keybase.io/ruiowolf) on keybase.
  • I have a public key whose fingerprint is E9BE C283 3570 941F BFED 2D46 8655 0F64 D19C 6446

To claim this, I am signing this object: