Skip to content

Instantly share code, notes, and snippets.

@evan-goode
Created February 17, 2016 19:38
Show Gist options
  • Save evan-goode/955f3c9d30b028b0acb9 to your computer and use it in GitHub Desktop.
Save evan-goode/955f3c9d30b028b0acb9 to your computer and use it in GitHub Desktop.
userscripts
var script = document.createElement("script")
script.id = "goodbye"
script.innerHTML = " \
window.onbeforeunload = null \
"
document.documentElement.appendChild(script)
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