Alt+Shift+Space shortcut to toggle restrictions enforcement for current tab (issue #129, thanks PF4Public for RFE).
This commit is contained in:
parent
5a9a235fa9
commit
996ec4b3bc
|
@ -176,6 +176,9 @@
|
|||
"EnforceForTab": {
|
||||
"message": "Enable restrictions for this tab"
|
||||
},
|
||||
"toggleEnforcementForTab": {
|
||||
"message": "Toggle restrictions enforcement for current tab"
|
||||
},
|
||||
"HighContrast": {
|
||||
"message": "High contrast"
|
||||
},
|
||||
|
|
|
@ -111,9 +111,19 @@
|
|||
}
|
||||
},
|
||||
|
||||
togglePermissions() {},
|
||||
install() {
|
||||
if ("command" in browser) {
|
||||
async toggleEnforcementForTab() {
|
||||
let [tab] = (await browser.tabs.query({
|
||||
currentWindow: true,
|
||||
active: true
|
||||
}));
|
||||
if (tab) {
|
||||
let toggle = ns.unrestrictedTabs.has(tab.id) ? "delete" : "add";
|
||||
ns.unrestrictedTabs[toggle](tab.id);
|
||||
browser.tabs.reload(tab.id);
|
||||
}
|
||||
},
|
||||
async install() {
|
||||
if ("commands" in browser) {
|
||||
// keyboard shortcuts
|
||||
browser.commands.onCommand.addListener(cmd => {
|
||||
if (cmd in Commands) {
|
||||
|
|
|
@ -144,10 +144,10 @@
|
|||
"default": "Alt+Shift+N"
|
||||
}
|
||||
},
|
||||
"togglePermissions": {
|
||||
"description": "Toggle permissions",
|
||||
"toggleEnforcementForTab": {
|
||||
"description": "__MSG_toggleEnforcementForTab__",
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Shift+T"
|
||||
"default": "Alt+Shift+Space"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue