Last active
August 29, 2015 14:19
-
-
Save dmann/049341e7e8da33e80842 to your computer and use it in GitHub Desktop.
This file contains 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 FB Auto Logout | |
// @description Automatically log out of Facebook when the tab is closed. | |
// @author D.Mann | |
// @include http://www.facebook.com/* | |
// @include https://www.facebook.com/* | |
// @version 1.0 | |
// ==/UserScript== | |
//document.getElementById('pageLoginAnchor').getElementsByTagName('a')[0].click(); | |
document.getElementById('pageLoginAnchor').click(); | |
document.body.setAttribute("onbeforeunload","forms = document.getElementsByTagName('form'); for (i=0; i<forms.length; i++) { if(forms[i].action.contains('logout.php')){forms[i].submit();} }"); | |
//document.body.setAttribute("onbeforeunload","document.getElementById('u_j_2').submit();"); | |
//document.body.setAttribute("onbeforeunload","document.getElementById('logout_form').getElementsByTagName('input')[4].click()"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment