Socket
Socket
Sign inDemoInstall

react-desktop-notification

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.5

9

index.js

@@ -9,2 +9,8 @@ /**

start: function(title, context, url, icon, name) {
name=name||("notiwin"+(function(n) {
var rnd = "";
for (var i = 0; i < n; i++)
rnd += Math.floor(Math.random() * 10);
return rnd;
})(5));
if (!Notification) {

@@ -18,4 +24,5 @@ console.log("Your browser is not support desktop notifications, please try Chrome or Firefox.");

} else {
icon=(icon&&icon.match(/^.*\.(jpeg|jpg|gif|png)/gi))?icon:"http://ob9oayzh3.bkt.clouddn.com/images.png"
var notification = new Notification(title, {
icon: icon || "http://ob9oayzh3.bkt.clouddn.com/images.png",
icon: icon,
body: context,

@@ -22,0 +29,0 @@ });

2

package.json
{
"name": "react-desktop-notification",
"version": "1.0.4",
"version": "1.0.5",
"description": "Use browser's desktop notification in React. It depends on notifications API of chrome or else browser's other way.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -14,7 +14,12 @@ ## react-desktop-notification

...
//Here will pop a notifier.
//Here will pop a notifier and always open in a new window when clicked.
Notifier.start("Title","Here is context","www.google.com","validated image url");
//Here will pop notifier and open in a specified name window "popwin1" when clicked.
Notifier.start("Title","Here is context","www.google.com","validated image url","popwin1");
...
}
```
## API
Notifier.start(notifier_title, notifier_context, opening_url, icon_url, window_name)

@@ -21,0 +26,0 @@ ## git

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc