Skip to content

hazae41/worker-online-polyfill

Repository files navigation

WebWorkers "online" and "offline" events polyfill

Polyfill for online and offline events on WebWorkers

https://issues.chromium.org/issues/40155587

npm i @hazae41/worker-online-polyfill

Node Package 📦

Features

  • ESModules and CommonJS
  • No external dependency

Usage

How?

ESModules

import "@hazae41/worker-online-polyfill"

CommonJS

require("@hazae41/worker-online-polyfill")

Where?

You can import the polyfill in your worker entry file or in a specific file

import "@hazae41/worker-online-polyfill"

self.addEventListener("online", () => console.log("online"))
self.addEventListener("offline", () => console.log("offline"))

About

Polyfill for online and offline events on WebWorkers

Resources

Stars

Watchers

Forks

Packages

No packages published