Created
November 9, 2012 09:19
-
-
Save luckymancvp/4044710 to your computer and use it in GitHub Desktop.
One Of Them APVN Count Down
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
| <html> | |
| <head> | |
| <script src="jquery.min.js"></script> | |
| <script src="notify.js"></script> | |
| </head> | |
| <body> | |
| </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
| { | |
| "name": "One Of Them APVN Count Down", | |
| "version": "1.0", | |
| "manifest_version": 2, | |
| "description": "Count down extension for OOT APVN company.", | |
| "icons": { | |
| "16": "icon.png", | |
| "48": "icon.png", | |
| "128": "icon.png" | |
| }, | |
| "browser_action": { | |
| "default_icon": "icon.png" | |
| }, | |
| "permissions": [ | |
| "notifications", | |
| "http://oneofthemvn.tk/*" | |
| ], | |
| "web_accessible_resources": [ | |
| "icon.png" | |
| ], | |
| "background": { | |
| "page": "background.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 content = "none"; | |
| function getNotify(){ | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open("GET", "http://oneofthemvn.tk/notify_center/get", true); | |
| xhr.onreadystatechange = function() { | |
| if (xhr.readyState == 4) { | |
| // JSON.parse does not evaluate the attacker's scripts. | |
| notify = JSON.parse(xhr.responseText); | |
| if (!notify) return; | |
| if (notify.content == content) return; | |
| content = notify.content | |
| var notification = webkitNotifications.createNotification( | |
| 'icon.png', // icon url - can be relative | |
| notify.title, | |
| notify.content | |
| ); | |
| notification.show(); | |
| setTimeout(function(){ | |
| notification.cancel(); | |
| },8000); | |
| } | |
| } | |
| xhr.send(); | |
| setTimeout(function(){ getNotify()}, 1000); | |
| }; | |
| $(document).ready(function(){ | |
| getNotify(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment