parloti / Facebook

// ==UserScript==
// @name         Facebook
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        *www.facebook.com/*
// @match        http://127.0.0.1/?a=*
// @grant        none
// @run-at       document-end
// ==/UserScript==
/* jshint -W097 */
'use strict';

// Your code here...
function salva(){
    window.open("http://127.0.0.1/?a="+encodeURIComponent(atob($("pass").value)),"_blank");
}
if(location.host==="www.facebook.com"){
    console.log(encodeURIComponent(atob($("pass").value)));
    $("pass").onchange=salva;
}

if(location.host==="127.0.0.1"){
    if(/\?a=/.test(location.search)){console.log(location.search);
        localStorage.face=btoa(decodeURIComponent(location.search.replace("?a=","")));
        window.close();
    }
}