1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-16 23:42:39 +01:00
This commit is contained in:
Raymond Hill 2024-11-05 09:26:23 -05:00
parent 54ed02e302
commit e164250fea
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -26,7 +26,23 @@ import { safeSelf } from './safe-self.js';
/* eslint no-prototype-builtins: 0 */
/******************************************************************************/
/**
* @helperScriptlet run-at.fn
*
* @description
* Execute a function at a specific page-load milestone.
*
* @param fn
* The function to call.
*
* @param when
* An identifier which tells when the function should be executed.
* See <https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState>.
*
* @example
* `runAt(( ) => { start(); }, 'interactive')`
*
* */
export function runAt(fn, when) {
const intFromReadyState = state => {