File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,14 @@ function createContextMenu(options) {
1818 title : title ,
1919 contexts : [ "image" ]
2020 } ) ;
21- for ( i = 0 ; i < options . searchProviders . length ; i ++ ) {
21+ for ( let searchProvider of options . searchProviders ) {
2222 var contextMenuOptions = {
2323 parentId : "Image-Reverse-Search" ,
24- id : options . searchProviders [ i ] ,
24+ id : searchProvider ,
2525 icons : {
26- 64 : "icons/" + options . searchProviders [ i ] + ".png"
26+ 64 : "icons/" + searchProvider + ".png"
2727 } ,
28- title : searchProviderNames [ options . searchProviders [ i ] ] ,
28+ title : searchProviderNames [ searchProvider ] ,
2929 contexts : [ "image" ]
3030 }
3131 try {
Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ function storeSettings() {
2525 /* Returns an array with all checked search providers */
2626 function getSearchProviders ( ) {
2727 const chosenSearchProviders = new Array ( )
28- for ( i = 0 ; i < allSearchProviders . length ; i ++ ) {
29- if ( document . getElementById ( allSearchProviders [ i ] ) . checked ) {
30- chosenSearchProviders . push ( allSearchProviders [ i ] )
28+ for ( let searchProvider of allSearchProviders ) {
29+ if ( document . getElementById ( searchProvider ) . checked ) {
30+ chosenSearchProviders . push ( searchProvider )
3131 }
3232 }
3333 return chosenSearchProviders
@@ -135,9 +135,9 @@ function updateUI(restoredSettings) {
135135 const tabAtSelectList = document . querySelector ( "#openTabAt" ) ;
136136 tabAtSelectList . value = restoredSettings . openTabAt ;
137137
138- for ( i = 0 ; i < allSearchProviders . length ; i ++ ) {
139- if ( restoredSettings . searchProviders . includes ( allSearchProviders [ i ] ) ) {
140- document . getElementById ( allSearchProviders [ i ] ) . checked = true ;
138+ for ( let searchProvider of allSearchProviders ) {
139+ if ( restoredSettings . searchProviders . includes ( searchProvider ) ) {
140+ document . getElementById ( searchProvider ) . checked = true ;
141141 }
142142 }
143143
You can’t perform that action at this time.
0 commit comments