npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nexts-html5-notification

v3.0.0

Published

Notification polyfill

Downloads

4

Readme

Build Status CircleCI

HTML 5 Desktop Notification

Support

  • IE 9+
  • Edge
  • Firefox 22+
  • Google Chrome 32+

Notes

  • [IE 9][IE 10] Does not support Promise. Polyfill required.

  • [MS Edge] Notifications supported for the latest version of Edge that comes with Windows 10 Anniversary Update

  • [Safari] Icon is not displayed - it uses the application icon instance of provided one

  • Have to type of icons - one image format that will be displayed for Chrome/Safari/Firefox and one in .ico format, 16x16 for IE The library automatically will parse the icon name and will add .ico extension if it is not .ico

    The icon resource file must contain a 16x16 icon at 96 dots per inch (dpi). If an icon overlay is already applied, the existing overlay is replaced. Note To view the icon overlay, the taskbar buttons must be in their default large icon mode. Small taskbar icons do not support icon overlays.

  • The Notification constructor(window.Notification) is replaced with custom one in order to polyill the missing properties/methods. Each instance created with new Notification('title') returns the original Notification object(for Chrome/Opera/Firefox/Safari/Edge) and custom Notification object for not supported browsers:

Permissions

Notification API defines 3 permission levels for supported environments:

  • default - This is equivalent to "denied", but the user has made no explicit choice thus far.
  • granted - This means notifications can be displayed.
  • denied - This means the user does not want notifications.

To support environments that do not implement Notification API, this code implements an additional permission level:

  • notsupported - Notification API is not supported in any format(WHATWG spec or prefixed). Notification could not be displayed. Any Notification API code execution will pass, but no notification will be displayed.

Usage: Use the Standard API for working with this notification library:

  • Notification.permission - to get the permissions for page
  • Notification.requestPermission() - request permission for displaying Notifications. NOTE: Returns a Promise. For IE9 & IE10 Promise polyfill required - it is not included within this library.
  • new Notification('title', options) - create new Notification. More details:
    • https://notifications.spec.whatwg.org/
    • https://developer.mozilla.org/en-US/docs/Web/API/notification

TODO

  • [ ] Home page - documentation & demo
  • [x] [IE] Add support for event listeners
  • [ ] [IE] Implement actions as a thumbBar buttons
  • [ ] Add Support for Service Workers