Created
December 10, 2011 01:53
-
-
Save minitech/1454242 to your computer and use it in GitHub Desktop.
Disables some "Remember Me" checkboxes on Firefox. GreaseMonkey user 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
// ==UserScript== | |
// @name Forget You | |
// @namespace about:blank | |
// @description Makes sure that users are never remembered, this being a public computer. | |
// ==/UserScript== | |
// Created by Ryan O'Hara (minitech), a customer. | |
// Enjoy my first Greasemonkey script! | |
// http://git.io/ry | |
function mtDisable() { | |
var items = []; | |
items.push(document.querySelector('#PersistentCookie')); | |
items.push(document.querySelector('#persistent')); | |
items.push(document.querySelector('[name=KMSI]')); | |
items.forEach(function(item) { | |
if(item) { | |
item.disabled = true; | |
item.title = 'This was disabled because you\'re using a public computer! If you really mean it, press Ctrl+Alt+A to re-enable.'; | |
} | |
}); | |
var ran = false; | |
window.addEventListener('keydown', function(e) { | |
if(e.keyCode === 65 && e.ctrlKey && e.altKey) { | |
if(ran) { | |
return; | |
} | |
ran = true; | |
e.preventDefault(); | |
items.forEach(function(item) { | |
if(item) { | |
item.disabled = false; | |
item.title = null; | |
} | |
}); | |
} | |
}, false); | |
} | |
window.addEventListener('DOMContentLoaded', mtDisable); | |
window.addEventListener('load', mtDisable); // Hotmail apparently re-enables in DOMContentLoaded or similar so we need this too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment