Greasy Fork is available in English.
Replaces relative GitLab timestamps with their full title
// ==UserScript==
// @name GitLab - show absolute timestamps
// @namespace https://gitlab.com/
// @version 1.0
// @description Replaces relative GitLab timestamps with their full title
// @match https://gitlab.com/*
// @grant none
// @license CC0-1.0
// ==/UserScript==
(function () {
'use strict';
function replaceTimes(root = document) {
root.querySelectorAll('time[title]').forEach(time => {
const title = time.getAttribute('title');
if (title && time.textContent !== title) {
time.textContent = title;
}
});
}
// Elementy obecne przy załadowaniu strony
replaceTimes();
// Elementy dodawane dynamicznie przez GitLaba
const observer = new MutationObserver(mutations => {
for (const mutation of mutations) {
for (const node of mutation.addedNodes) {
if (node.nodeType !== Node.ELEMENT_NODE) {
continue;
}
if (node.matches && node.matches('time[title]')) {
node.textContent = node.getAttribute('title');
}
replaceTimes(node);
}
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();