JavaScript Restrictor
Browser extension that improves privacy and security
Loading...
Searching...
No Matches
wrappingS-COOP-SCHEDULING.js File Reference

Wrappers for Cooperative Scheduling of Background Tasks API. More...

Detailed Description

Wrappers for Cooperative Scheduling of Background Tasks API.

See also
https://w3c.github.io/requestidlecallback/#the-requestidlecallback-method
Author
Copyright (C) 2022 Libor Polcak
License:
SPDX-License-Identifier: GPL-3.0-or-later

The window.requestIdleCallback() API can schedule background tasks such that they do not introduce delays to other high priority tasks that share the same event loop, such as input processing, animations and frame compositing.

But the API leaks information about the other tasks running in the browser as it leaks information on currently scheduled tasks, vsync deadlines, user-interaction and so on.

JShelter modifies the return call to:

  1. Never leak the information that the call was triggered by an expired timeout.
  2. Fake the information on remaining time in synchronization with the Date.now() wrapper. Returns up to 50% more time compared to the original value.