Created
April 11, 2017 13:56
-
-
Save anonymous/a7639ab89ad57c7456f94326bb2f7c20 to your computer and use it in GitHub Desktop.
Adds a header with a link to the moderator tools in the new topbar review menu
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 SO Topbar Review Dialog Tools | |
// @namespace http://tinygiant.io | |
// @version 1.0.0.0 | |
// @description Adds a header with a link to the moderator tools in the new topbar review menu | |
// @author @TinyGiant | |
// @include /^https?:\/\/(?!chat)\w*.?(stackexchange.com|stackoverflow.com|serverfault.com|superuser.com|askubuntu.com|stackapps.com|mathoverflow.net)\/.*/ | |
// @grant none | |
// ==/UserScript== | |
/* jshint esnext: true */ | |
(function() { | |
'use strict'; | |
const open = XMLHttpRequest.prototype.open; | |
XMLHttpRequest.prototype.open = function(...args) { | |
this.addEventListener('load', event => { | |
if(!/topbar\/review/.test(event.target.responseURL)) return; | |
document.querySelector('.review-dialog').insertAdjacentHTML('afterbegin', ` | |
<div class="header"> | |
<h3>Review</h3> | |
<span class="pull-right"><a href="//stackoverflow.com/tools">tools</a></span> | |
</div> | |
`); | |
}, false); | |
open.apply(this, args); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment