Skip to main content

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.

shell npm install @michaeldrotar/focus-tracker-js --save

<script src="/node_modules/@michaeldrotar/focus-tracker-js/dist/index.js"></script>
<script>
window.focusTracker.register(document.body)
window.focusTracker.start()
</script>