Page title notifications switch between the default page title and a notification message continously in order to grab the user’s attention. This is commonly used with chat applications.
To activate the page title notification call the following:
Then call the following to turn it off:
The default speed is 1000 milliseconds, but this can be customised by passing a 2nd parameter to the
pageTitleNotification.on("New Message!", 5000);
There are various ways you can integrate this into your project:
npm install flashing-page-title-notification --save
Full source code available on GitHub. Please feel free to raise any issues or pull requests!