Browser console override implementing Beacon API to push logging to a known endpoint.
npm install --save scrybl
This is really the first time I've touched this repo in 4 years.
There are a couple breaking changes made to this repo in v2 from "v0."
- I've updated the repo and code with inclusive language.
- Primary branch has been renamed from
master
tomain
. - The instantiation parameter
whitelist
has been renamed toallowList
- Primary branch has been renamed from
- The original class name was a typo, and has been renamed from
Scryb
toScrybl
to match the repo.
Release cycles between clients and endpoints don't always jive, and sometimes you need to release code in a client ahead of the backend. Alternatively, there may be a staged rollout of a new production feature, enabling a feature for X number of users based on certain criteria.
Set disabled
to true to effectively NOOP this library, and the console object will remain untouched.
Before, this library optimistically called the Beacon API. This would obviously throw an error in the event that navigator
isn't a global, or sendBeacon
isn't a method on the navigator
global. Instantiation now bails if the Beacon API doesn't exist, as though the library were called with disabled
set to true.
Previously, silent mode wasn't respected when a NOOP'd function was called. This has been fixed.
console.log
will now always be made available in its underscore form regardless of allowlist.