Created
September 17, 2015 16:08
-
-
Save ccarruitero/bb095ecb2fc190e0c96e to your computer and use it in GitHub Desktop.
notification extension
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": "notification", | |
"version": "0.1", | |
"applications": { | |
"gecko": { | |
"id": "[email protected]" | |
} | |
}, | |
"browser_action": { | |
"default_icon": "dog.png", | |
"default_popup": "notify.html" | |
}, | |
"permissions": ["notifications"] | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<a id="notify">click me!</a> | |
<script src="script.js"></script> | |
</body> | |
</html> |
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
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