From 85dd515d204791a780a9c980c62a2f57ad8a274a Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sat, 2 Nov 2024 22:17:54 +0300 Subject: [PATCH] Added DuckDuckGo AI Chat https://github.com/libredirect/browser_extension/issues/969 --- src/assets/images/chatGpt-icon-light.svg | 10 ++++++++++ src/assets/images/chatGpt-icon.svg | 1 + src/assets/javascripts/services.js | 3 +++ src/config.json | 19 +++++++++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 src/assets/images/chatGpt-icon-light.svg create mode 100644 src/assets/images/chatGpt-icon.svg diff --git a/src/assets/images/chatGpt-icon-light.svg b/src/assets/images/chatGpt-icon-light.svg new file mode 100644 index 00000000..b3df81fb --- /dev/null +++ b/src/assets/images/chatGpt-icon-light.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/images/chatGpt-icon.svg b/src/assets/images/chatGpt-icon.svg new file mode 100644 index 00000000..e04db75a --- /dev/null +++ b/src/assets/images/chatGpt-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index e85b5bf1..0a6b3e94 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -555,6 +555,9 @@ function rewrite(url, originUrl, frontend, randomInstance) { const accountReg = /^\/([^\/]+)\/?$/.exec(url.pathname) if (accountReg) return `${randomInstance}/account${url.pathname}${url.search}` + case "duckDuckGoAiChat": + return "https://duckduckgo.com/?q=DuckDuckGo+AI+Chat&ia=chat&duckai=1" + case "piped": case "pipedMaterial": case "cloudtube": diff --git a/src/config.json b/src/config.json index 340df46c..48eecc24 100644 --- a/src/config.json +++ b/src/config.json @@ -219,6 +219,25 @@ "embeddable": true, "url": "https://twitter.com" }, + "chatGpt": { + "frontends": { + "duckDuckGoAiChat": { + "name": "DuckDuckGo AI Chat", + "instanceList": false, + "url": "https://duckduckgo.com/duckduckgo-help-pages/aichat/" + } + }, + "targets": ["^https?:\\/{2}chatgpt\\.com"], + "name": "ChatGPT", + "options": { + "enabled": false, + "unsupportedUrls": "bypass", + "frontend": "duckDuckGoAiChat", + "redirectOnlyInIncognito": false + }, + "imageType": "svgMono", + "url": "https://chatgpt.com/" + }, "bluesky": { "frontends": { "skyview": {