Last active
March 2, 2017 21:11
-
-
Save dannyroberts/83cd9bd00f8c396c6b61 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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