Skip to content

Instantly share code, notes, and snippets.

Created April 11, 2017 13:56
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 anonymous/a7639ab89ad57c7456f94326bb2f7c20 to your computer and use it in GitHub Desktop.
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
// ==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