File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 },
3131 "toggle-cosmetic-filtering" : {
3232 "description" : " __MSG_toggleCosmeticFiltering__"
33+ },
34+ "toggle-javascript" : {
35+ "description" : " __MSG_toggleJavascript__"
3336 }
3437 },
3538 "content_scripts" : [
Original file line number Diff line number Diff line change 12531253 "message" : " Toggle cosmetic filtering" ,
12541254 "description" : " Label for keyboard shortcut used to toggle cosmetic filtering"
12551255 },
1256+ "toggleJavascript" : {
1257+ "message" : " Toggle JavaScript" ,
1258+ "description" : " Label for keyboard shortcut used to toggle no-scripting switch"
1259+ },
12561260 "relaxBlockingMode" : {
12571261 "message" : " Relax blocking mode" ,
12581262 "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 => {
136136 // Tab-specific commands
137137 const tab = await vAPI . tabs . getCurrent ( ) ;
138138 if ( tab instanceof Object === false ) { return ; }
139+
139140 switch ( command ) {
140141 case 'launch-element-picker' :
141142 case 'launch-element-zapper' : {
@@ -168,6 +169,13 @@ vAPI.commands.onCommand.addListener(async command => {
168169 hostname : hostnameFromURI ( µb . normalizeTabURL ( tab . id , tab . url ) ) ,
169170 } ) ;
170171 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 ;
171179 default :
172180 break ;
173181 }
You can’t perform that action at this time.
0 commit comments