mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -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
|
||||
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()
|
||||
}
|
||||
})
|
||||
}
|
||||
// }
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue