Skip to content

Commit

Permalink
Added Notification sound & update notification
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulkapoor90 committed Dec 5, 2016
1 parent a45efef commit de80e7c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
Binary file added Extension for chrome/audio/notification.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion Extension for chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@
},
"permissions": [ "activeTab", "https://ajax.googleapis.com/", "http://*/*", "storage", "webRequestBlocking", "webRequest", "downloads", "*://vtop.vit.ac.in/*", "notifications" ],
"short_name": "VES",
"version": "1.2.1",
"version": "1.2.2",
"web_accessible_resources": [ "scripts/*", "https://storage.googleapis.com/code.getmdl.io/1.0.0/material.indigo-pink.min.css", "https://fonts.googleapis.com/icon?family=Material+Icons", "calc.js" ]
}
19 changes: 19 additions & 0 deletions Extension for chrome/scripts/background/background.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
function audioNotification(){
var yourSound = new Audio('audio/notification.mp3');
yourSound.play();
}
chrome.runtime.onInstalled.addListener(function(details){
if(details.reason == "update"){
var thisVersion = chrome.runtime.getManifest().version;
audioNotification();
var opt = {
type: "basic",
title: "Hello Friend!",
message: "VITacademics Enhancement Suite has been updated with new features and bug fixes.",
iconUrl: chrome.extension.getURL('images/github-logo.png')
}
chrome.notifications.create(opt);
}
});

function install_notice() {
if (localStorage.getItem('install_time'))
return;
Expand All @@ -11,6 +29,7 @@ var opt = {
message: "Thank You for installing VITacademics Enhancement Suite.",
iconUrl: chrome.extension.getURL('images/github-logo.png')
}
audioNotification();
chrome.notifications.create(opt);
}
var notify1 = function(data){
Expand Down

0 comments on commit de80e7c

Please sign in to comment.