Skip to content

Instantly share code, notes, and snippets.

@dannyroberts
Last active March 2, 2017 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannyroberts/83cd9bd00f8c396c6b61 to your computer and use it in GitHub Desktop.
Save dannyroberts/83cd9bd00f8c396c6b61 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Clean FogBugz URLs
// @version 0.4
// @description Replaces http://manage.dimagi.com/default.asp?123456#1984701 with http://manage.dimagi.com/default.asp?123456
// @author Danny Roberts
// @match *://manage.dimagi.com/default.asp*
// @grant none
// ==/UserScript==
function cleanURL() {
if (!document.getElementById('bugerror') &&
(/https?:\/\/manage.dimagi.com\/default.asp\?\d+#\d+/.exec(window.location.href))) {
history.replaceState("", document.title, window.location.pathname + window.location.search);
}
};
window.onhashchange = function () {
cleanURL();
};
cleanURL();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment