Endle/fireSeqSearch

Support custom search engines

krillin666 opened this issue ยท 10 comments

Hello @Endle , amazing work !
Would it be possible to support custom search engines like the open source SearX ? Even better would be to let the user set various search engines URLs to this plugin to apply on like: DDG, SearX, Google ...

Thank you for your time !

Endle commented

Hi, thank you for your suggestion.

It's obvious that people want to add more search engine supports, for example, duckduckgo: #17

I'm open to supporting more search engines. However, I don't think a custom search engine could be possible. If I want to support a new engine, I need to do the following:

  1. Edit permission in manifest.json :
  2. Insert a dom to the web page, considering the different page structure for the new search engine
    document.body.insertBefore(div, document.body.firstChild);

Currently, my js implementation is too hacky, and too hard-coded for Google. I'm thinking of re-factoring my js code, making it easier to add more search engine support.

PRs are welcomed, including some hacks for a new search engine. I have no timeline for the refactoring I planned, and I don't want to block users from accessing new search engines.

Endle commented

Hi @krillin666

I had a try with SearX. Their DOM looks quite clean to me

Screenshot 2022-05-17 at 16-52-28 searx tiekoetter com

I think it won't cost me too much time to provide a hack for it.

However, the domain is an issue. I refrain from adding all searx.* domains to the host list. I would feel untrustable when a web extension is asking for a loose range of permissions, and I'll avoid that as a developer.

I have no knowledge about SearX (I spend some time googling it before writing this comment). I have two naive questions before adding support for SearX

  1. Is there a widely used, stable domain for SearX? If so, I can consider adding it right now
  2. If self-host a SearX instance, is there a typical URL? For example, 127.0.0.1/SearX (I know nothing. I just guess)

Hi @Endle thank you so much for taking the time to research this !

  1. The most common used instances I gather should be: https://searx.be/, https://searx.fmac.xyz/ and https://searx.prvcy.eu/. Being that they have the best features, the server is outside the US and have been maintained the longest.
  2. If you self host an instance you could access it by the local domain (would be just 127.0.0.1 or something similar), but if you want to access outside your local LAN you must set up a reverse proxy which could be anything like: google.krillin.com

With this information, if you do have the time, I think the best is just supporting those three main instances which would cover must users. Besides, you can choose any instance you want, so If a user wants to benefit from this project we could then choose one of these instances if he's not already using those.

Thank you for your time !

Endle commented

Screenshot 2022-05-20 at 17-48-02 SearXNG

I'm working on supporting SearX

Endle commented

@krillin666 I added support to searx.prvcy.eu and searx.fmac.xyz in version https://github.com/Endle/fireSeqSearch/releases/tag/0.0.7 These two sites have almost identical DOM structure

So happy that Mozilla approves my update while I'm writing this comment https://addons.mozilla.org/en-US/firefox/addon/fireseqsearch/versions/

If there is any issue when using these two sites, please no hesitate to open a new issue.

I'll remain this issue open for a while. I'm thinking if I could find a solution for custom search engines. At least I could refractor my code so adding a new search engine support would be easier

Since searx is a meta search engine it would be cool if this local server served the results in a format where Logseq notes could be actual hits (with title and description) but that's likely another project

Endle commented

where Logseq notes could be actual hits

Let me share a SECRET with you

image

Update to the latest version of the server and Firefox extension, then there is an experimental function for showing a summary.

Endle commented

I'll remain this issue open for a while. I'm thinking if I could find a solution for custom search engines. At least I could refractor my code so adding a new search engine support would be easier

I had to eat my words. I haven't found a proper way yet. If anyone wants support for a new engine, new PR plz, and I'll do it ASAP.

Hi @Endle , thank you so much for adding those 2 instances of searX. However, the results are not appearing in those two instances, is there any bug ? Could you see if it appears for you, please?

I also have another question: Sometime, I use other SearX instances, would it be possible for the user to define the instances he wants to use ?

Endle commented

Hi @krillin666

Hi @Endle , thank you so much for adding those 2 instances of searX. However, the results are not appearing in those two instances, is there any bug ? Could you see if it appears for you, please?

Thank you for reporting it. It is a bug. I've created #103 and I'll be working on the fix

I also have another question: Sometime, I use other SearX instances, would it be possible for the user to define the instances he wants to use ?

I wish so. However, as I mentioned,

I haven't found a proper way yet. If anyone wants support for a new engine, new PR plz, and I'll do it ASAP.