mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Fix #822: add button to toggle Tridactyl
This commit is contained in:
parent
ab5e069fae
commit
31398ec903
6 changed files with 136 additions and 1 deletions
|
@ -84,6 +84,31 @@ browser.tabs.onActivated.addListener(ev => {
|
|||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* Let users disable Tridactyl by clicking the browserAction button
|
||||
*/
|
||||
browser.browserAction.onClicked.addListener(() => {
|
||||
const toIgnore = config.get("superignore") == "true" ? "false" : "true"
|
||||
const iconDetails = toIgnore == "true" ?
|
||||
{ path : {
|
||||
"64": "static/logo/Tridactyl_red_64px.png",
|
||||
"100": "static/logo/Tridactyl_red_100px.png",
|
||||
"150": "static/logo/Tridactyl_red_150px.png",
|
||||
}} :
|
||||
{ path: {
|
||||
"64": "static/logo/Tridactyl_64px.png",
|
||||
"100": "static/logo/Tridactyl_100px.png",
|
||||
"150": "static/logo/Tridactyl_150px.png",
|
||||
}}
|
||||
if (toIgnore == "true") {
|
||||
excmds_background.fillcmdline("Tridactyl disabled, refresh pages to take effect")
|
||||
} else {
|
||||
// TODO: work out how to send a notification even while Tridactyl is disabled
|
||||
}
|
||||
browser.browserAction.setIcon(iconDetails)
|
||||
config.set("superignore", toIgnore)
|
||||
})
|
||||
|
||||
/**
|
||||
* Declare Tab Event Listeners
|
||||
*/
|
||||
|
|
|
@ -122,5 +122,13 @@
|
|||
},
|
||||
"omnibox": {
|
||||
"keyword": "tri"
|
||||
},
|
||||
"browser_action": {
|
||||
"browser_style": true,
|
||||
"default_icon": {
|
||||
"64": "static/logo/Tridactyl_64px.png",
|
||||
"100": "static/logo/Tridactyl_100px.png",
|
||||
"150": "static/logo/Tridactyl_150px.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
BIN
src/static/logo/Tridactyl_red_100px.png
Normal file
BIN
src/static/logo/Tridactyl_red_100px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
src/static/logo/Tridactyl_red_150px.png
Normal file
BIN
src/static/logo/Tridactyl_red_150px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8 KiB |
BIN
src/static/logo/Tridactyl_red_64px.png
Normal file
BIN
src/static/logo/Tridactyl_red_64px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
102
src/static/logo/tridactyl_red.svg
Normal file
102
src/static/logo/tridactyl_red.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 110 KiB |
Loading…
Add table
Reference in a new issue