mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Add commands
API bind, <C-,>
for escapehatch
This commit is contained in:
parent
64e8b3033e
commit
a54e7cde95
3 changed files with 18 additions and 1 deletions
|
@ -244,6 +244,11 @@ omnibox.init()
|
|||
|
||||
// }}}
|
||||
|
||||
browser.commands.onCommand.addListener((command_name: string) => {
|
||||
if (command_name !== "escape_hatch") return
|
||||
excmds_background.escapehatch()
|
||||
})
|
||||
|
||||
// {{{ Obey Mozilla's orders https://github.com/tridactyl/tridactyl/issues/1800
|
||||
|
||||
native.unfixamo()
|
||||
|
|
|
@ -2936,6 +2936,10 @@ export async function shellescape(...quoteme: string[]) {
|
|||
* Magic escape hatch: return to a tab in the current window where Tridactyl can run, making such a tab if it doesn't currently exist.
|
||||
*
|
||||
* Only useful if called from a background context, e.g. at the end of an RC file to ensure that when you start the browser you don't get trapped on an about: page.
|
||||
*
|
||||
* By default, bound to `<C-,>` via the commands API which may be changed via about:addons, the cog icon in the top right, then "Manage Extension Shortcuts"
|
||||
*
|
||||
* <!-- TODO: add `bind --mode=mozilla` to rebind this + remove the special casing in background.ts -->
|
||||
*/
|
||||
//#background
|
||||
export async function escapehatch() {
|
||||
|
|
|
@ -15,6 +15,14 @@
|
|||
"chrome_url_overrides": {
|
||||
"newtab": "static/newtab.html"
|
||||
},
|
||||
"commands": {
|
||||
"escape_hatch": {
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Comma"
|
||||
},
|
||||
"description": "Focus or create a tab in which Tridactyl can run"
|
||||
}
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": [
|
||||
|
@ -75,4 +83,4 @@
|
|||
"omnibox": {
|
||||
"keyword": "tri"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue