@@ -188,8 +188,10 @@ completion.noscriptSites = function (context) {
188
188
context . generate = getSites ;
189
189
context . keys = {
190
190
text : util . identity ,
191
- description : site => groupDesc [ this . highlight ] +
192
- ( this . groups . untrusted && this . highlight != "NoScriptUntrusted" ? " (untrusted)" : "" ) ,
191
+ description : function ( site ) {
192
+ return groupDesc [ this . highlight ] +
193
+ ( this . groups . untrusted && this . highlight != "NoScriptUntrusted" ? " (untrusted)" : "" )
194
+ } ,
193
195
194
196
highlight : function ( site ) {
195
197
return this . groups . temp ? "NoScriptTemp" :
@@ -243,7 +245,7 @@ prefs.complete = group => context => {
243
245
context . keys = { text : "text" , description : "description" } ;
244
246
context . completions = values ( prefs [ group ] ) ;
245
247
} ;
246
- prefs . get = function ( group ) { return [ p . text for ( p of values ( this [ group ] ) ) if ( getPref ( p . pref ) ) ] ; } ;
248
+ prefs . get = function ( group ) { return [ for ( p of values ( this [ group ] ) ) if ( getPref ( p . pref ) ) p . text ] ; } ;
247
249
prefs . set = function ( group , val ) {
248
250
for ( let p of values ( this [ group ] ) )
249
251
setPref ( p . pref , val . indexOf ( p . text ) >= 0 ) ;
@@ -292,27 +294,27 @@ group.options.add(["script"],
292
294
has : ( val ) => hasOwnProperty ( services . noscript . jsPolicySites . sitesMap , val ) &&
293
295
! hasOwnProperty ( services . noscript . tempSites . sitesMap , val ) ,
294
296
get set ( ) {
295
- return new RealSet ( k for ( k in services . noscript . jsPolicySites . sitesMap ) )
296
- . difference ( new RealSet ( k for ( k in services . noscript . tempSites . sitesMap ) ) )
297
+ return new RealSet ( ( for ( k of services . noscript . jsPolicySites . sitesMap ) k ) )
298
+ . difference ( new RealSet ( ( for ( k of services . noscript . tempSites . sitesMap ) k ) ) )
297
299
}
298
300
} , {
299
301
names : [ "noscript-tempsites" , "nst" ] ,
300
302
description : "The list of sites temporarily allowed to execute scripts" ,
301
303
action : ( add , sites ) => sites . length && noscriptOverlay . safeAllow ( sites , add , true , - 1 ) ,
302
304
completer : ( context ) => completion . noscriptSites ( context ) ,
303
- get set ( ) { return new RealSet ( k for ( k in services . noscript . tempSites . sitesMap ) ) } ,
305
+ get set ( ) { return new RealSet ( ( for ( k of iter ( services . noscript . tempSites . sitesMap ) ) k ) ) } ,
304
306
} , {
305
307
names : [ "noscript-untrusted" , "nsu" ] ,
306
308
description : "The list of untrusted sites" ,
307
309
action : ( add , sites ) => sites . length && services . noscript . setUntrusted ( sites , add ) ,
308
310
completer : ( context ) => completion . noscriptSites ( context ) ,
309
- get set ( ) { return new RealSet ( k for ( k in services . noscript . untrustedSites . sitesMap ) ) } ,
311
+ get set ( ) { return new RealSet ( ( for ( k of iter ( services . noscript . untrustedSites . sitesMap ) ) k ) ) } ,
310
312
} , {
311
313
names : [ "noscript-objects" , "nso" ] ,
312
314
description : "The list of allowed objects" ,
313
315
get set ( ) { return new RealSet ( array . flatten (
314
- [ Array . concat ( v ) . map ( function ( v ) { return v + "@" + this ; } , k )
315
- for ( [ k , v ] of iter ( services . noscript . objectWhitelist ) ) ] ) ) } ,
316
+ [ for ( wListObj of iter ( services . noscript . objectWhitelist ) )
317
+ Array . concat ( wListObj [ 1 ] ) . map ( function ( v ) { return v + "@" + this ; } , wListObj [ 0 ] ) ] ) ) } ,
316
318
action : function ( add , patterns ) {
317
319
for ( let pattern of values ( patterns ) ) {
318
320
let [ mime , site ] = util . split ( pattern , / @ / , 2 ) ;
0 commit comments