PageSourceSearch

https://www.ninjaone.com/wp-content/themes/ninjaone/js/helpers/schedulerPostTaskModule.js

js ninjaone.com collected 2026-09-24 08:44:31 UTC 718 bytes, 27 lines download raw bytes

1function runWhenIdle(callback, priority = 'background', args = null) {
2  if ('scheduler' in window && 'postTask' in scheduler) {
3    scheduler.postTask(callback, { priority });
4  } else if ('requestIdleCallback' in window) {
5    window.requestIdleCallback(() => {
6        callback(args);
7    });
8  } else {
9    window.requestAnimationFrame(() => {
10        callback(args);
11    });
12  }
13}
14
15export const scheduleTaskAfterLoad = (callback, priority, args = null) => {
16  window.addEventListener('load', () => {
17    runWhenIdle(() => {
18      callback(args);
19    }, priority, args);
20  });
21};
22
23export const scheduleTask = (callback, priority, args = null) => {
24  runWhenIdle(() => {
25    callback(args);
26  }, priority, args);
27};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.