clock barra Facebook

Facebook clock

目前為 2020-05-14 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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.6
// @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("button");
A.title ='1click per salire in alto doppio click per post recenti';
var e ='background-color:green;color:red!important;border:1px solid yellow;font-size:16px;border-radius:12px;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/nascondi",myFunctionclock);