Facebook Logout Shortcut Just Press Alt+L

Press Alt+L to logout

  1. // ==UserScript==
  2. // @name Facebook Logout Shortcut Just Press Alt+L
  3. // @namespace
  4. // @version 3.1.4
  5. // @description Press Alt+L to logout
  6. // @include http*://*.facebook.com/*
  7. // @grant none
  8. // @copyright Devendra Pratap Singh
  9. // ==/UserScript==
  10.  
  11. window.onload = function(){
  12. document.getElementById('userNavigationLabel').click();
  13. document.getElementById('userNavigationLabel').click();
  14. }
  15.  
  16. var eventUtility = {
  17. addEvent : function(el, type, fn) {
  18. if (typeof addEventListener !== "undefined") {
  19. el.addEventListener(type, fn, false);
  20. } else if (typeof attachEvent !== "undefined") {
  21. el.attachEvent("on" + type, fn);
  22. } else {
  23. el["on" + type] = fn;
  24. }
  25. }
  26. };
  27.  
  28. (function() {
  29. eventUtility.addEvent(document, "keydown",
  30. function(evt) {
  31. var code = evt.keyCode,
  32. altKey = evt.altKey;
  33. if (altKey && code === 76) {
  34. console.log("logging out!");
  35. document.forms[document.forms.length-1].submit();
  36. }
  37. });
  38. }());

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址