Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
let lastPressed = -1;

window.addEventListener("keydown", event => {
	if (event.key === "\\") {
		if (new Date().getTime() - lastPressed < 1000) {
			let input = document.createElement("input", { id: "searchInput" });
			document.body.appendChild(input);

			input.style.border = "none";
			input.style.outline = "none";
			input.style.background = "none";
			input.style.position = "fixed";
			input.style.top = "calc(100% - 100px)";
			input.style.left = "0px";
			input.style.width = "100%";
			input.style.textAlign = "center";
			input.style.zIndex = "5";
			input.style.fontSize = "3em";

			input.focus();
			input.onblur = function() {
				input.remove();
			}

			input.onkeydown = e => {
				if (e.key.toLowerCase() === "enter") {
					location.href = "https:" + mw.config.get("wgServer") + "/wiki/" + input.value;
				}
			}

			input.oninput = e => {
				if (e.data === "\\") {
					input.value = "";
				}
			}
		} else {
			lastPressed = new Date().getTime();
		}
	}
});