summaryrefslogtreecommitdiffstats
path: root/src/js/commands.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/commands.js')
-rw-r--r--src/js/commands.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/js/commands.js b/src/js/commands.js
index 8fd6341..2f29b23 100644
--- a/src/js/commands.js
+++ b/src/js/commands.js
@@ -136,8 +136,11 @@ vAPI.commands.onCommand.addListener(async command => {
// Tab-specific commands
const tab = await vAPI.tabs.getCurrent();
if ( tab instanceof Object === false ) { return; }
+
switch ( command ) {
case 'launch-element-picker':
+ if ( µb.userFiltersAreEnabled() === false ) { break; }
+ /* fall through */
case 'launch-element-zapper': {
µb.epickerArgs.mouse = false;
µb.elementPickerExec(
@@ -168,6 +171,13 @@ vAPI.commands.onCommand.addListener(async command => {
hostname: hostnameFromURI(µb.normalizeTabURL(tab.id, tab.url)),
});
break;
+ case 'toggle-javascript':
+ µb.toggleHostnameSwitch({
+ name: 'no-scripting',
+ hostname: hostnameFromURI(µb.normalizeTabURL(tab.id, tab.url)),
+ });
+ vAPI.tabs.reload(tab.id);
+ break;
default:
break;
}