Created
February 17, 2016 19:38
-
-
Save evan-goode/955f3c9d30b028b0acb9 to your computer and use it in GitHub Desktop.
userscripts
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 script = document.createElement("script") | |
script.id = "goodbye" | |
script.innerHTML = " \ | |
window.onbeforeunload = null \ | |
" | |
document.documentElement.appendChild(script) |
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 script = document.createElement("script") | |
script.id = "notifier" | |
script.innerHTML = " \ | |
window.alert = window.confirm = function(alert) { \ | |
if (Notification.permission === 'granted') { \ | |
var notification = new Notification(alert) \ | |
} \ | |
else if (Notification.permission !== 'denied') { \ | |
Notification.requestPermission(function (permission) { \ | |
if (permission === 'granted') { \ | |
var notification = new Notification(alert) \ | |
} \ | |
}) \ | |
} \ | |
} \ | |
" | |
document.documentElement.appendChild(script) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment