mrswitch / notification.js Goto Github PK
View Code? Open in Web Editor NEWA shim polyfill for adding notifications to browsers which offer limited support
Home Page: https://adodson.com/notification.js/
License: MIT License
A shim polyfill for adding notifications to browsers which offer limited support
Home Page: https://adodson.com/notification.js/
License: MIT License
Right now checking permissions (on browsers that support it) returns a kind of binary response, either "granted" or "denied": https://github.com/MrSwitch/notification.js/blob/master/notification.js#L97
The problem with that is that there are cases where it's useful to differentiate why notifications are not currently allowed.
I think Notification.permission
could return these possible values (just as an example):
unknown
enabled
disabled
denied
Hello, the way your shim works disables the Native HTML5 Desktop Notifications in Firefox 22, i have written a small gist that should streamline the small differences i have discovered in the implementations of WebKit, Blink and Gecko.
Just random feedback, not working when:
Tested using mobile Chrome 46.0.2490.76
Android 5.0.1
But it works great when trying the demo using the default android "Internet" browser.
Curious on whether will it work if I have a web app wrap by android webview?
http://developer.android.com/reference/android/webkit/WebView.html
Anyway, this notification on mobile is super awesome.
Hi, thanks for the library. Can we have .close()
take a time argument and execute after time passes? I tried window.setTimeout(n.close, 1000)
and got a TypeError: Illegal invocation
error. Probably has something to do with this
:
https://developer.mozilla.org/en-US/docs/Web/API/Window.setTimeout#The_.22this.22_problem
This would be even better with Ubuntu Notification support.
Bower could not to install the package.
Could you publish the one?
Is there any reason why you explicitly have the code:
this.onclick = function(){};
this.onclose = function(){};
instead of:
this.onclick = options.onclick || function(){};
this.onclose = options.onclose || function(){};
?
Can I play sound when receiving a notification?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.