From 312dfedabe4d9c9913d689feba960a3a4f200c78 Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Fri, 10 Aug 2018 23:46:36 +0100 Subject: [PATCH] Fix #880: block / usage on all sites --- src/content.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/content.ts b/src/content.ts index 72be798c..caf687d2 100644 --- a/src/content.ts +++ b/src/content.ts @@ -190,25 +190,25 @@ config.getAsync("leavegithubalone").then(v => { if (v == "true") return try { // On quick loading pages, the document is already loaded - if (document.location.host == "github.com") { + // if (document.location.host == "github.com") { + document.body.addEventListener("keydown", function(e) { + if ("/".indexOf(e.key) != -1) { + e.cancelBubble = true + e.stopImmediatePropagation() + } + }) + // } + } catch (e) { + // But on slower pages we wait for the document to load + window.addEventListener("DOMContentLoaded", () => { + // if (document.location.host == "github.com") { document.body.addEventListener("keydown", function(e) { if ("/".indexOf(e.key) != -1) { e.cancelBubble = true e.stopImmediatePropagation() } }) - } - } catch (e) { - // But on slower pages we wait for the document to load - window.addEventListener("DOMContentLoaded", () => { - if (document.location.host == "github.com") { - document.body.addEventListener("keydown", function(e) { - if ("/".indexOf(e.key) != -1) { - e.cancelBubble = true - e.stopImmediatePropagation() - } - }) - } + // } }) } })