File tree 3 files changed +15
-0
lines changed
3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 30
30
},
31
31
"toggle-cosmetic-filtering" : {
32
32
"description" : " __MSG_toggleCosmeticFiltering__"
33
+ },
34
+ "toggle-javascript" : {
35
+ "description" : " __MSG_toggleJavascript__"
33
36
}
34
37
},
35
38
"content_scripts" : [
Original file line number Diff line number Diff line change 1253
1253
"message" : " Toggle cosmetic filtering" ,
1254
1254
"description" : " Label for keyboard shortcut used to toggle cosmetic filtering"
1255
1255
},
1256
+ "toggleJavascript" : {
1257
+ "message" : " Toggle JavaScript" ,
1258
+ "description" : " Label for keyboard shortcut used to toggle no-scripting switch"
1259
+ },
1256
1260
"relaxBlockingMode" : {
1257
1261
"message" : " Relax blocking mode" ,
1258
1262
"description" : " Label for keyboard shortcut used to relax blocking mode"
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ vAPI.commands.onCommand.addListener(async command => {
136
136
// Tab-specific commands
137
137
const tab = await vAPI . tabs . getCurrent ( ) ;
138
138
if ( tab instanceof Object === false ) { return ; }
139
+
139
140
switch ( command ) {
140
141
case 'launch-element-picker' :
141
142
case 'launch-element-zapper' : {
@@ -168,6 +169,13 @@ vAPI.commands.onCommand.addListener(async command => {
168
169
hostname : hostnameFromURI ( µb . normalizeTabURL ( tab . id , tab . url ) ) ,
169
170
} ) ;
170
171
break ;
172
+ case 'toggle-javascript' :
173
+ µb . toggleHostnameSwitch ( {
174
+ name : 'no-scripting' ,
175
+ hostname : hostnameFromURI ( µb . normalizeTabURL ( tab . id , tab . url ) ) ,
176
+ } ) ;
177
+ vAPI . tabs . reload ( tab . id ) ;
178
+ break ;
171
179
default :
172
180
break ;
173
181
}
You can’t perform that action at this time.
0 commit comments