Skip to content

Commit

Permalink
fix: remove broken search engines
Browse files Browse the repository at this point in the history
Closes #313.
  • Loading branch information
dessant committed Jun 24, 2024
1 parent 2d40193 commit 4d6d554
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 245 deletions.
3 changes: 0 additions & 3 deletions src/assets/icons/engines/clipretrieval.svg

This file was deleted.

18 changes: 0 additions & 18 deletions src/assets/icons/engines/enterpix.svg

This file was deleted.

12 changes: 0 additions & 12 deletions src/assets/icons/engines/haveibeentrained.svg

This file was deleted.

7 changes: 0 additions & 7 deletions src/assets/icons/engines/immerse.svg

This file was deleted.

60 changes: 0 additions & 60 deletions src/assets/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,26 +224,6 @@
"description": "Name of the search engine."
},

"engineName_haveibeentrained": {
"message": "Have I Been Trained?",
"description": "Name of the search engine."
},

"engineName_enterpix": {
"message": "Enterpix",
"description": "Name of the search engine."
},

"engineName_immerse": {
"message": "Immerse",
"description": "Name of the search engine."
},

"engineName_clipretrieval": {
"message": "Clip Retrieval",
"description": "Name of the search engine."
},

"engineName_freepik": {
"message": "Freepik",
"description": "Name of the search engine."
Expand Down Expand Up @@ -490,26 +470,6 @@
"description": "Title of the menu item."
},

"menuItemTitle_haveibeentrained": {
"message": "Have I Been Trained?",
"description": "Title of the menu item."
},

"menuItemTitle_enterpix": {
"message": "Enterpix",
"description": "Title of the menu item."
},

"menuItemTitle_immerse": {
"message": "Immerse",
"description": "Title of the menu item."
},

"menuItemTitle_clipretrieval": {
"message": "Clip Retrieval",
"description": "Title of the menu item."
},

"menuItemTitle_freepik": {
"message": "Freepik",
"description": "Title of the menu item."
Expand Down Expand Up @@ -776,26 +736,6 @@
"description": "Title of the option."
},

"optionTitle_haveibeentrained": {
"message": "Have I Been Trained?",
"description": "Title of the option."
},

"optionTitle_enterpix": {
"message": "Enterpix",
"description": "Title of the option."
},

"optionTitle_immerse": {
"message": "Immerse",
"description": "Title of the option."
},

"optionTitle_clipretrieval": {
"message": "Clip Retrieval",
"description": "Title of the option."
},

"optionTitle_freepik": {
"message": "Freepik",
"description": "Title of the option."
Expand Down
25 changes: 0 additions & 25 deletions src/engines/clipretrieval.js

This file was deleted.

29 changes: 0 additions & 29 deletions src/engines/enterpix.js

This file was deleted.

23 changes: 0 additions & 23 deletions src/engines/haveibeentrained.js

This file was deleted.

28 changes: 0 additions & 28 deletions src/engines/immerse.js

This file was deleted.

7 changes: 5 additions & 2 deletions src/storage/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@
"20231102164602_add_icons8",
"20240514170322_add_appversion",
"20240529183556_update_search_engines",
"20240619180111_add_menuchangeevent"
"20240619180111_add_menuchangeevent",
"20240624161944_remove_search_engines"
],
"session": ["20240514122825_initial_version"]
"session": [
"20240514122825_initial_version"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const message = 'Remove search engines';

const revision = '20240624161944_remove_search_engines';

async function upgrade() {
const changes = {};
const {engines, disabledEngines} = await browser.storage.local.get([
'engines',
'disabledEngines'
]);

const removeEngines = [
'haveibeentrained',
'enterpix',
'immerse',
'clipretrieval'
];

changes.engines = engines.filter(function (item) {
return !removeEngines.includes(item);
});
changes.disabledEngines = disabledEngines.filter(function (item) {
return !removeEngines.includes(item);
});

changes.storageVersion = revision;
return browser.storage.local.set(changes);
}

export {message, revision, upgrade};
39 changes: 1 addition & 38 deletions src/utils/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,32 +330,6 @@ const engines = {
isExec: true
}
},
haveibeentrained: {
url: {target: 'https://haveibeentrained.com/?url={imgUrl}'},
image: {
target: 'https://haveibeentrained.com/',
isExec: true
}
},
enterpix: {
image: {
target: 'https://enterpix.app/',
isExec: true
}
},
immerse: {
url: {target: 'https://www.immerse.zone/image?url={imgUrl}'},
image: {
target: 'https://www.immerse.zone/',
isExec: true
}
},
clipretrieval: {
image: {
target: 'https://knn.laion.ai/',
isExec: true
}
},
freepik: {
image: {
target: 'https://www.freepik.com/search',
Expand Down Expand Up @@ -391,8 +365,6 @@ const engineIconVariants = {
ascii2d: ['dark'],
tmview: ['dark'],
pixta: ['dark'],
immerse: ['dark'],
clipretrieval: ['dark'],
freepik: ['dark']
};

Expand Down Expand Up @@ -618,10 +590,6 @@ const webpEngineSupport = [
'lykdat',
'googleLens',
'lexica',
'haveibeentrained',
'enterpix',
'immerse',
'clipretrieval',
'icons8'
];

Expand All @@ -635,8 +603,7 @@ const avifEngineSupport = [
'alibabaChina',
'dreamstime',
'pond5',
'lexica',
'enterpix'
'lexica'
];

const maxImageUploadSize = {
Expand Down Expand Up @@ -683,10 +650,6 @@ const maxImageUploadSize = {
googleLens: {api: 20 * 1024 * 1024},
lexica: {ui: 30 * 1024 * 1024},
kagi: {ui: 1 * 1024 * 1024},
haveibeentrained: {ui: 10 * 1024 * 1024},
enterpix: {ui: 5 * 1024 * 1024},
immerse: {ui: 10 * 1024 * 1024},
clipretrieval: {ui: 15 * 1024 * 1024},
freepik: {ui: 60 * 1024 * 1024},
icons8: {ui: 5 * 1024 * 1024}
};
Expand Down

0 comments on commit 4d6d554

Please sign in to comment.