NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Facebook Logout Shortcut Just Press Alt+L
// @namespace
// @version 1.0.1
// @description Press Alt+L to logout
// @include http*://facebook.com/*
// @include http*://*.facebook.com/*
// @grant none
// @copyright Devendra Pratap Singh
// ==/UserScript==
var eventUtility = {
addEvent : function(el, type, fn) {
if (typeof addEventListener !== "undefined") {
el.addEventListener(type, fn, false);
} else if (typeof attachEvent !== "undefined") {
el.attachEvent("on" + type, fn);
} else {
el["on" + type] = fn;
}
}
};
(function() {
eventUtility.addEvent(document, "keydown",
function(evt) {
var code = evt.keyCode,
altKey = evt.altKey;
console.log(code);
if (altKey && code === 76) {
document.getElementById("logout_form").submit();
}
});
}());