mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Fix #1185 - add blacklistkeys setting
This commit is contained in:
parent
233a94cd80
commit
7b6508a3e1
2 changed files with 13 additions and 4 deletions
|
@ -319,10 +319,14 @@ config.getAsync("modeindicator").then(mode => {
|
|||
})
|
||||
|
||||
function protectSlash(e) {
|
||||
if ("/".indexOf(e.key) !== -1 && contentState.mode === "normal") {
|
||||
e.cancelBubble = true
|
||||
e.stopImmediatePropagation()
|
||||
}
|
||||
config.get("blacklistkeys").map(
|
||||
protkey => {
|
||||
if (protkey.indexOf(e.key) !== -1 && contentState.mode === "normal") {
|
||||
e.cancelBubble = true
|
||||
e.stopImmediatePropagation()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// Some sites like to prevent firefox's `/` from working so we need to protect
|
||||
|
|
|
@ -309,6 +309,11 @@ class default_config {
|
|||
*/
|
||||
leavegithubalone: "true" | "false" = "false"
|
||||
|
||||
/**
|
||||
* Which keys to protect from pages that try to override them. Requires [[leavegithubalone]] to be set to false.
|
||||
*/
|
||||
blacklistkeys: string[] = ["/"]
|
||||
|
||||
/**
|
||||
* Autocommands that run when certain events happen, and other conditions are met.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue