3 ms·
This bookmarklet (I prefer to do it on purpose, not by default) would do this on a GitHub page. It is easy to convert it to a userscript. javascript:(function
by elashri 2y ago
This bookmarklet (I prefer to do it on purpose, not by default) would do this on a GitHub page. It is easy to convert it to a userscript.
javascript:(function () { document.querySelectorAll("relative-time").forEach(function (el) { var p = el.parentNode; var t = el.title; var s = document.createElement("span"); s.innerHTML = t; p.removeChild(el); p.appendChild(s); }); })();
- fngjdflmdflg 2y agoShorter version javascript:(()=> {document.querySelectorAll("relative-time").forEach((el)=> el.format="datetime")})() based on docs at https://github.com/github/relative-time-element https://github.com/github/relative-time-element you can also do other formats like document.querySelectorAll("relative-time").forEach((el)=> {el.format= "datetime"; el.year ="numeric"; el.weekday=undefined;})
- fngjdflmdflg 2y agoshortened version still using <span>, as that has better line wrapping: document.querySelectorAll("relative-time").forEach((el)=>el.replaceWith(document.createElement("span").innerHTML = el.title))