Browser
For direct browser usage, install the package and then load the main distribution file. The window.focusTracker
namespace will hold all the documented functionality.
tip
If possible, it is preferable to use the module version and only import the necessary pieces. See the module documentation for more information.
- npm
- yarn
- pnpm
shell npm install @michaeldrotar/focus-tracker-js --save
shell yarn add @michaeldrotar/focus-tracker-js
shell pnpm add @michaeldrotar/focus-tracker-js
<script src="/node_modules/@michaeldrotar/focus-tracker-js/dist/index.js"></script>
<script>
window.focusTracker.register(document.body)
window.focusTracker.start()
</script>