Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chemmi/66142ab69962cdb40352039d48c87561 to your computer and use it in GitHub Desktop.
Save chemmi/66142ab69962cdb40352039d48c87561 to your computer and use it in GitHub Desktop.
This simple js bookmark let you display the correct commit timestamp at github, see also https://www.freecodecamp.org/news/what-are-bookmarklets/
# Chrome
javascript:(function() {
var relativeTimeElements = window.document.querySelectorAll("relative-time");
relativeTimeElements.forEach(function(timeElement){
timeElement.shadowRoot.innerHTML = timeElement.shadowRoot.innerHTML +" -- "+ timeElement.title;
})
}())
# Firefox
javascript:(function() {
var relativeTimeElements = window.document.querySelectorAll("relative-time");
relativeTimeElements.forEach(function(timeElement){
timeElement.innerHTML = timeElement.innerHTML +" -- "+ timeElement.title;
})
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment