Skip to content

close-watcher

NPM version

Platform Support

Platform Support

Platform Support

Platform Support

intro:

Listening for closing requests Reference WICG close-watcher

Usage

Currently CloseWatcher has been injected into the global environment, which means that the standard has been implemented in advance, so it can be used directly.

ts
const closeWatcher = new CloseWatcher();
closeWatcher.addEventListener("close", (event) => {
  closeWatcher.close();
});

CloseWatcher is consumable, and each new will prevent a system rollback.

On desktop it is the offset esc button

Released under the MIT License.