chatgpt-google-extension icon indicating copy to clipboard operation
chatgpt-google-extension copied to clipboard

add support for most search engines

Open josStorer opened this issue 1 year ago • 11 comments

related: #1 #8 #20 #21 #22 #24

Now support Google, Bing, Yahoo, DuckDuckGo, StartPage, Baidu, Kagi, Yandex, Naver, Brave, Searx, Ecosia Have a try here: https://github.com/josStorer/chat-gpt-search-engine-extension/releases

Preview:

bing duckduckgo google kagi naver startpage yahoo jp yahoo yandex baidu brave searx ecosia

josStorer avatar Dec 06 '22 05:12 josStorer

related: #1 #8 #20 #21 #22 #24

josStorer avatar Dec 06 '22 05:12 josStorer

Wow thanks, I'll take a look tomorrow

wong2 avatar Dec 06 '22 15:12 wong2

This is a review generated by ChatGPT 🤩:

This pull request appears to add support for multiple search engines to a browser extension that displays ChatGPT responses alongside search results. The extension currently only supports Google, but this pull request aims to add support for Bing, Yahoo, DuckDuckGo, StartPage, Baidu, Kagi, Yandex, Naver, Brave, Searx, and Ecosia.

One potential problem with this pull request is that it hardcodes the input element names for search boxes into the config variable. This means that if any of the search engines supported by this extension change the name of their search box input elements, the extension will no longer be able to find them and will not be able to display ChatGPT responses alongside search results.

To fix this issue, I would suggest using a more flexible approach for identifying search box input elements. One way to do this would be to use the querySelectorAll method to search for elements with the input tag and the search or query attribute, rather than hardcoding specific input element names into the config variable.

Another potential problem with this pull request is that it adds a large number of new configuration options to the config variable, which makes the code difficult to read and understand. To improve readability and make it easier to maintain the code, I would suggest moving the configuration options for each search engine into a separate object. This would make it easier to add, remove, or modify the configuration options for individual search engines without having to scroll through a long list of options.

Overall, I think this pull request has the potential to add useful functionality to the extension, but it would benefit from some changes to improve its flexibility and readability.

kxxt avatar Dec 07 '22 14:12 kxxt

@kxxt That's cool

wong2 avatar Dec 07 '22 14:12 wong2

@wong2 are you currently working on this PR? If not, I can do some updates tomorrow to make it more flexible and readable

josStorer avatar Dec 07 '22 14:12 josStorer

@josStorer I'm not.

wong2 avatar Dec 07 '22 14:12 wong2

Please resolve conflicts

wong2 avatar Dec 08 '22 06:12 wong2

@wong2 resolved

josStorer avatar Dec 08 '22 06:12 josStorer

Nice work, @josStorer!

jonathansampson avatar Dec 08 '22 15:12 jonathansampson

@wong2 have updated and tested, it works fine

josStorer avatar Dec 08 '22 16:12 josStorer

thanks, I'll merge after more tests tomorrow

wong2 avatar Dec 08 '22 17:12 wong2

I'll merge this and do some fixes myself.

wong2 avatar Dec 09 '22 11:12 wong2

大佬厉害

ghost avatar Dec 21 '22 07:12 ghost