Github Time Formatter Forked

Give Real Time on Github instead of approximate time

2020/11/27のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name           Github Time Formatter Forked
// @namespace      Github Time Formatter Forked
// @description    Give Real Time on Github instead of approximate time
// @version        1.0.
// @include       http*://github.com/*
// @run-at document-start
// ==/UserScript==

(function(){
	'use strict';
	function format(timeElem){
		var time=timeElem.title||timeElem.datetime;
		if(time){
			timeElem.innerHTML=time;
		}
	}
	function onDOMSubtreeModifiedHandler(e){
		var target = e.target;
		// console.log(target);
		if(target.nodeType === 1 && /TIME/ig.test(target.nodeName)&&/ago/.test(target.innerHTML)) {
			format(target);
		}
	}
	(function(){
		var matches = document.querySelectorAll('time');
		for(var i = 0; i < matches.length; ++i) {
			format(matches[i]);
		}
	})();
	document.addEventListener('DOMSubtreeModified', onDOMSubtreeModifiedHandler, false);
})();