Created
April 25, 2014 19:38
-
-
Save sowbug/11300656 to your computer and use it in GitHub Desktop.
A different way of letting users know that your Chrome extension or app has been installed/updated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.runtime.onInstalled.addListener(function() { | |
var options = { | |
type: "basic", | |
title: "Version " + | |
chrome.runtime.getManifest().version + | |
" installed", | |
message: "Just thought you'd like to know that this extension is now installed!", | |
iconUrl: "assets/icon_128.png" | |
}; | |
// In a real extension or app, you'd examine the current version and | |
// compare it to the last time you displayed the message. | |
var shouldDisplayInstallationMessage = true; | |
if (shouldDisplayInstallationMessage) { | |
chrome.notifications.create("my_id", options, function(id) { | |
console.log("created", id); | |
}); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest_version": 2, | |
"name": "Hello World", | |
"version": "1.2.3.4", | |
"icons": { | |
"16": "assets/icon_16.png", | |
"128": "assets/icon_128.png" | |
}, | |
"permissions": [ | |
"notifications" | |
], | |
"background": { | |
"scripts": ["event.js"], | |
"persistent": false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment