Skip to content

Instantly share code, notes, and snippets.

@Ffisegydd
Created August 12, 2014 18:44
Show Gist options
  • Save Ffisegydd/982a834dbb4879cf9e88 to your computer and use it in GitHub Desktop.
Save Ffisegydd/982a834dbb4879cf9e88 to your computer and use it in GitHub Desktop.
Get the Revision History (originally written by Kevin Kevinson)
// ==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