Function waitForElementOrInteractive

Returns a Promise that is resolved when the given checkFn function returns a value other than null or undefined or the Document:readyState becomes "interactive".

It always calls the given checkFn first before examining the readyState.

If the readyState became interactive before the element was found, the Promise resolves to null. Otherwise the Promise is resolved with checkFn's return value.

The function is called initially, and then every time there are changes to the DOM children. Uses MutationObserver.