Created
July 17, 2012 07:48
-
-
Save Dandu-Venkata-Ravi-Varma/3127857 to your computer and use it in GitHub Desktop.
Developing a Chrome extension
This file contains 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
<script type="text/JavaScript"> | |
// Create a simple html notification: | |
setInterval(function() { | |
var notification = webkitNotifications.createHTMLNotification('notification.html'); | |
notification.show(); | |
}, 3600000); | |
</script> |
This file contains 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
{ | |
"name": "Timely", | |
"description": "For every one hour a popup message will be appeard reminding another hour passed by.", | |
"version": "2.1", | |
"background_page": "background.html", | |
"browser_action": { | |
"default_popup": "popup.html" | |
}, | |
"permissions": [ | |
"tabs", | |
"http://*/*", | |
"https://*/*", | |
"notifications", | |
"storage", | |
"webNavigation", | |
"contextMenus" | |
] | |
} |
This file contains 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
{ | |
"name": "", | |
"description": "", | |
"version": "", | |
"background_page": "", | |
"browser_action": {}, | |
"content_scripts": [ | |
{} | |
], | |
"permissions": [] | |
} |
This file contains 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
<html> | |
<head> | |
</head> | |
<body> | |
<h1>WhatsUp???</h1> | |
<form name="form" onsubmit="JavaScript:storage();return false;"> | |
<b>Enter your status:</b> | |
<input type="text" name="status" id="status"/> | |
<input type="button" value="Submit" onclick="JavaScript:storage();return false;" /> | |
</form> | |
</body> | |
<script> | |
function storage(){ | |
var d = new Date(); | |
var date = d.getDate(); | |
var month = d.getMonth(); | |
var year = d.getFullYear(); | |
var hours = d.getHours(); | |
var minutes = d.getMinutes(); | |
var seconds = d.getSeconds(); | |
var today = date+"/"+month+"/"+year; | |
var time = hours+":"+minutes+":"+seconds; | |
localStorage[today]=localStorage[today]||JSON.stringify({}); | |
var store = JSON.parse(localStorage[today]); | |
store[time]=JSON.stringify(document.getElementById("status").value); | |
localStorage[today]=JSON.stringify(store); | |
console.log(localStorage,localStorage[today],store[time],document.getElementById("status").value); | |
window.close(); | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment