Skip to content

Instantly share code, notes, and snippets.

@supahgreg
Created August 3, 2011 15:31
Show Gist options
  • Select an option

  • Save supahgreg/1122916 to your computer and use it in GitHub Desktop.

Select an option

Save supahgreg/1122916 to your computer and use it in GitHub Desktop.
Press escape to close Quake Live's Game Summary, Live Game Info and notification popups
// ==UserScript==
// @id [email protected]
// @name Quake Live Escaper
// @version 1.6
// @namespace phob.net
// @author wn
// @description Press escape to close Quake Live's Game Summary, Live Game Info and notification popups
// @include http://*.quakelive.com/*
// @exclude http://*.quakelive.com/forum*
// @run-at document-end
// @updateURL https://gist.github.com/raw/1122916/[email protected]
// ==/UserScript==
function QLE(win) {
document.addEventListener("keyup", function(e) {
if (e.keyCode != 27) return;
win.quakelive.matchtip.HideMatchTooltip(-1);
win.jQuery("#stats_details, #ql_notifier .ql_notice").remove();
}, false);
}
if (/Firefox/i.test(navigator.userAgent)) {
QLE(unsafeWindow);
}
else {
var scriptNode = document.createElement("script");
scriptNode.setAttribute("type", "text/javascript");
scriptNode.text = "(" + QLE.toString() + ")(window);";
document.body.appendChild(scriptNode);
document.body.removeChild(scriptNode);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment