Skip to content

Instantly share code, notes, and snippets.

@ccarruitero
Created September 17, 2015 16:08
Show Gist options
  • Save ccarruitero/bb095ecb2fc190e0c96e to your computer and use it in GitHub Desktop.
Save ccarruitero/bb095ecb2fc190e0c96e to your computer and use it in GitHub Desktop.
notification extension
{
"manifest_version": 2,
"name": "notification",
"version": "0.1",
"applications": {
"gecko": {
"id": "[email protected]"
}
},
"browser_action": {
"default_icon": "dog.png",
"default_popup": "notify.html"
},
"permissions": ["notifications"]
}
<!doctype html>
<html>
<head>
</head>
<body>
<a id="notify">click me!</a>
<script src="script.js"></script>
</body>
</html>
var notifyBtn = document.querySelector('#notify');
notifyBtn.addEventListener("click", function(e) {
chrome.notifications.create('notification', {
iconUrl: "dog.png",
title: "a notification example",
message: "notification message"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment