Aggiungi pulsante per tornare su facebook
当前为
// ==UserScript==
// @name facebook recent
// @author figuccio
// @namespace https://greasyfork.org/users/237458
// @description Aggiungi pulsante per tornare su facebook
// @version 0.6
// @include *
// @exclude https://drive.google.com/*
// @grant GM_addStyle
// ==/UserScript==
/*Crea un pulsante in un div contenitore. Sarà in stile e posizionato con CSS.
*/
if (window.top != window.self)// eseguire solo su frame principale (evita doppio dispay)
return;
var zNode = document.createElement ('div');
zNode.innerHTML = '<button id="myButton" type="button">'
+ 'facerec</button>'
;
zNode.setAttribute ('id', 'myContainer');
document.body.appendChild (zNode);
//--- Attiva il pulsante appena aggiunto.
document.getElementById ("myButton").addEventListener (
"click",function(){window.location.href = "https://www.facebook.com/?sk=h_chr"; (0,0); }, false);
//--- Dai uno stile ai nostri nuovi elementi aggiunti usando i CSS.GM_addStyle (` `);
GM_addStyle (multilineStr (function() {/*
#myButton {
position: fixed;
top: 0;
left: 0;
text-align: left;
font-size: 11pt;
font-weight: bold;
cursor: pointer;
color: red!important;
background-color: green;
border: 2px solid blue;
border-radius: 12px;
z-index: 50000;
padding: 6px 8px;
text-decoration: none;
}
*/}));
//questo ha sistemato il problema (` `);le personalizazioni dei colori del pulsante #myButton anche se apparentemente disattivati funzionano regolarmente
function multilineStr (dummyFunc) {
var str = dummyFunc.toString();
str = str.replace (/^[^\/]+\/\*!?/, '') //Funzione strip () { /*!
.replace (/\s*\*\/\s*\}\s*$/, '') // Strip */ }
.replace (/\/\/.+$/gm, '') // I commenti a doppia barra rovinano i CSS.
;
return str;
}