On page or native Notifications
Just vanilla javascript, no jQuery or other libraries. Styles and examples included in repo. Same parameters as browser's default Notification()
function
This page is showing notifications periodically every 8 seconds, and automatically hide them 15 seconds from display. (so max 2 notifications at the same tame).
When tab is active notification is on page, when you switch to another tab, notifications will be shown by browser Notification()
function.
If native notifications are not working
The described behavior can be changed using the settings by inlined text/json
object.
Possible problems?
The mjs extension must have the correct mime type set to text/javascript
, if it is too laborious, rename the suffix from .mjs
to .js
.
Services
Unpkg: https://unpkg.com/notific-on-page-or-native-notifications
NPM: https://www.npmjs.com/package/notific-on-page-or-native-notifications
Licence
CC BY-SA 4.0
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
For more info:
- Readme in standalone file /README.md
- Repo on Github
- Webpage about function https://iiic.dev/notific-on-page-or-native-notifications