@@ -11,7 +11,7 @@ var Provider = class Provider {
1111} ;
1212
1313const defaultProviders = [
14- new Provider ( 'Google' , 'icons/google.png' , 'https://www .google.com/searchbyimage?image_url =%s' , true ) ,
14+ new Provider ( 'Google' , 'icons/google.png' , 'https://lens .google.com/uploadbyurl?url =%s' , true ) ,
1515 new Provider ( 'IQDB' , 'icons/iqdb.png' , 'https://iqdb.org/?url=%s' ) ,
1616 new Provider ( 'TinEye' , 'icons/tineye.png' , 'https://www.tineye.com/search?url=%s' ) ,
1717 new Provider ( 'Bing' , 'icons/bing.png' , 'https://www.bing.com/images/searchbyimage?FORM=IRSBIQ&cbir=sbi&imgurl=%s' ) ,
@@ -96,7 +96,15 @@ const defaultSettings = {
9696 If we don't, then store the default settings. */
9797function checkStoredSettings ( storedSettings ) {
9898 if ( Object . getOwnPropertyNames ( storedSettings ) . length ) {
99- chrome . storage . sync . get ( null , createContextMenu ) ;
99+ chrome . storage . sync . get ( null , ( settings ) => {
100+ for ( let provider of settings . storageProviders ) {
101+ if ( provider . url === 'https://www.google.com/searchbyimage?image_url=%s' ) {
102+ provider . url = 'https://lens.google.com/uploadbyurl?url=%s' ;
103+ }
104+ }
105+ chrome . storage . sync . set ( settings ) ;
106+ createContextMenu ( settings ) ;
107+ } ) ;
100108 } else {
101109 chrome . storage . sync . set ( defaultSettings ) ;
102110 createContextMenu ( defaultSettings ) ;
@@ -144,13 +152,13 @@ function reverseSearch(info, storedSettings) {
144152 function openImageSearch ( tabs ) {
145153 const tabIndex = getTabIndex ( openTabAt , tabs ) ;
146154 const thisTab = tabs . filter ( t => t . active ) [ 0 ] ;
147-
155+
148156 for ( const p of searchProviders ) {
149157 chrome . tabs . create ( {
150158 url : p . replace ( '%s' , encodeURIComponent ( imageURL ) ) ,
151159 active : ! openInBackground ,
152160 index : tabIndex ,
153- openerTabId : thisTab . id ,
161+ openerTabId : thisTab . id ,
154162 } ) ;
155163 }
156164 }
0 commit comments