Created
August 12, 2014 18:44
-
-
Save Ffisegydd/982a834dbb4879cf9e88 to your computer and use it in GitHub Desktop.
Get the Revision History (originally written by Kevin Kevinson)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name revision viewer | |
// @namespace about:blank | |
// @description Adds a "revisions" button to SO's post menu | |
// @include http://stackoverflow.com/questions/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var url = document.URL; | |
var target = url.slice(0, url.lastIndexOf("/")).replace("questions", "posts") + "/revisions"; | |
var menu = document.getElementsByClassName("post-menu")[0] | |
var sep = document.createElement("span"); | |
sep.className = "lsep"; | |
sep.innerHTML = "|"; | |
menu.appendChild(sep); | |
var link = document.createElement("a"); | |
link.innerHTML = "revisions"; | |
link["href"] = target; | |
menu.appendChild(link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment