File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed
Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 4.1.2
4+
5+ - Replace Google Image Search with Google Lens because Google removed the old reverse search. This will also apply to current users.
6+
37## 4.1.1
48
59- Add Content-Security-Policy for options page
Original file line number Diff line number Diff line change 88 {
99 "name" : " Google" ,
1010 "icon" : " icons/google.png" ,
11- "url" : " https://www .google.com/searchbyimage?image_url =%s" ,
11+ "url" : " https://lens .google.com/uploadbyurl?url =%s" ,
1212 "selected" : true
1313 },
1414 {
Original file line number Diff line number Diff line change @@ -4,6 +4,21 @@ import { getMessage } from '../utils.js';
44const PARENT_ID = 'Image-Reverse-Search' ;
55const OPEN_ALL_ID = 'openAll' ;
66
7+ export const migrate = async ( options ) => {
8+ // v4.1.2: Use new Google Image Search URL
9+ for ( const storageProvider of options . storageProviders ) {
10+ if (
11+ storageProvider . url ===
12+ 'https://www.google.com/searchbyimage?image_url=%s'
13+ ) {
14+ storageProvider . url = 'https://lens.google.com/uploadbyurl?url=%s' ;
15+ }
16+ }
17+
18+ await chrome . storage . sync . set ( options ) ;
19+ return options ;
20+ } ;
21+
722export const setupContextMenu = ( {
823 storageProviders,
924 showOpenAll,
Original file line number Diff line number Diff line change 11import defaultOptions from '../default-options.json' ;
22import {
3+ migrate ,
34 onReverseSearch ,
45 setupContextMenu ,
56} from './service-worker-functions.js' ;
67
78chrome . runtime . onInstalled . addListener ( ( ) =>
8- chrome . storage . sync . get ( defaultOptions ) . then ( setupContextMenu )
9+ chrome . storage . sync . get ( defaultOptions ) . then ( migrate ) . then ( setupContextMenu )
910) ;
1011
1112chrome . contextMenus . onClicked . addListener ( onReverseSearch ) ;
You can’t perform that action at this time.
0 commit comments