Last active
August 29, 2015 13:58
-
-
Save LordJZ/9992884 to your computer and use it in GitHub Desktop.
VK.com HTML5 Notifications for Firefox (http://userscripts.org/scripts/show/448652)
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
| // ==UserScript== | |
| // @name VK HTML5 Notifications | |
| // @namespace vk-com | |
| // @include https://vk.com/* | |
| // @include http://vk.com/* | |
| // @version 1 | |
| // @grant none | |
| // ==/UserScript== | |
| let p = window.Notification.prototype; | |
| if (typeof p.show != "function") { | |
| p.show = function() {}; | |
| } | |
| if (typeof p.cancel != "function") { | |
| p.cancel = function() {}; | |
| } | |
| window.webkitNotifications = { | |
| checkPermission: function () { | |
| if (window.Notification.permission == "granted") { | |
| return 0; | |
| } | |
| return 1; | |
| }, | |
| requestPermission: function() { | |
| window.Notification.requestPermission(); | |
| }, | |
| createNotification: function(icon, title, text) { | |
| return new window.Notification(title, { body: text, icon: icon }); | |
| } | |
| }; | |
| if (window.cur && typeof window.cur.notify_on == "boolean") { | |
| window.cur.notify_on = true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment