Aggiungi pulsante per tornare su facebook
Fra
// ==UserScript==
// @name facebook recent
// @author figuccio
// @namespace https://greasyfork.org/users/237458
// @description Aggiungi pulsante per tornare su facebook
// @version 0.4
// @include *
// @exclude https://drive.google.com/*
// @grant GM_addStyle
// ==/UserScript==
/*Crea un pulsante in un div contenitore. Sarà in stile e posizionato con CSS.
*/
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);
function ButtonClickAction (zEvent) {
/*---Per la nostra azione fittizia, aggiungeremo solo una riga di testo in alto
dello schermo.
*/
var zNode = document.createElement ('p');
zNode.innerHTML = 'The button was clicked.';
document.getElementById ("myContainer").appendChild (zNode);
}
//--- Dai uno stile ai nostri nuovi elementi aggiunti usando i CSS.
GM_addStyle (`
#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;
}
`);