clock barra Facebook

Facebook clock

当前为 2020-05-14 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);