Greasy Fork is available in English.

clock barra Facebook

Facebook clock

اعتبارا من 18-05-2020. شاهد أحدث إصدار.

// ==UserScript==
// @name           clock barra Facebook
// @namespace      https://greasyfork.org/users/237458
// @description    Facebook clock
// @include        http://*.facebook.com/*
// @include        https://*.facebook.com/*
// @author         figuccio
// @version        0.7
// @grant          GM_addStyle
// @grant          GM_setValue
// @grant          GM_getValue
// @grant          GM_registerMenuCommand
// ==/UserScript==
/*_2t-f originale  _2s1y  time spostato ha destra  */
var blueBar = document.getElementsByClassName("_2s1y")[0];

var A = document.createElement("span");
A.title ='1click per salire in alto doppio click per post recenti';
var e ='color:yellow!important;font-size:16px;height:40px;margin-Top:0px;';
A.style.cssText = e;

blueBar.appendChild(A);

function clockTime() {
        var today = new Date();
        var h = today.getHours();
        var m = today.getMinutes();
        var s = today.getSeconds();
        var milli = today.getMilliseconds()
        var options = {'day':'2-digit','year':'numeric','month':'2-digit','weekday':'short'};
        var date = new Date().toLocaleDateString('it-IT', options);
        if (h < 10) h = "0" + h;
        if (m < 10) m = "0" + m;
        if (s < 10) s = "0" + s;
        A.innerText = h + ":" + m + ":" + s+ ":" +milli+ " "+date;;
        setTimeout(clockTime, 70);
    }
    clockTime();

      //funzione torna il alto
A.addEventListener('click', function(){ window.scrollTo(0,0);});
      //funzione ordina facebook recenti fare doppio click
A.addEventListener('dblclick', function(){ window.location.href = "https://www.facebook.com/?sk=h_chr";});

 function myFunctionclock() {
 if (A.style.display === 'none') {
   A.style.display = 'block';
  } else {
    A.style.display = 'none';
  }
}
GM_registerMenuCommand("mostra clock/nascondi clock",myFunctionclock);