mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Fix #880: block / usage on all sites
This commit is contained in:
parent
703a8ac611
commit
312dfedabe
1 changed files with 13 additions and 13 deletions
|
@ -190,25 +190,25 @@ config.getAsync("leavegithubalone").then(v => {
|
||||||
if (v == "true") return
|
if (v == "true") return
|
||||||
try {
|
try {
|
||||||
// On quick loading pages, the document is already loaded
|
// 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) {
|
document.body.addEventListener("keydown", function(e) {
|
||||||
if ("/".indexOf(e.key) != -1) {
|
if ("/".indexOf(e.key) != -1) {
|
||||||
e.cancelBubble = true
|
e.cancelBubble = true
|
||||||
e.stopImmediatePropagation()
|
e.stopImmediatePropagation()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
// }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// But on slower pages we wait for the document to load
|
// But on slower pages we wait for the document to load
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
if (document.location.host == "github.com") {
|
// if (document.location.host == "github.com") {
|
||||||
document.body.addEventListener("keydown", function(e) {
|
document.body.addEventListener("keydown", function(e) {
|
||||||
if ("/".indexOf(e.key) != -1) {
|
if ("/".indexOf(e.key) != -1) {
|
||||||
e.cancelBubble = true
|
e.cancelBubble = true
|
||||||
e.stopImmediatePropagation()
|
e.stopImmediatePropagation()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
// }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue