ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
315 stars 35 forks source link

CS Toolbar as a major Browser Search Engine #700

Open Sagitee opened 1 month ago

Sagitee commented 1 month ago

Hi and thanks for the great addon. Would it be possible for the CS Toolbar menu address (.../searchbar.html) to function as a search engine address eg. .../searchbar.html/[externally searched terms] so as to be able:

  1. to be set as the default search engine of the browser or of any external app that opens the browser when it makes a webSearch?
  2. to transfer those search terms to its search field (and optionally proceed to an autosearch eg. using its first search engine)?

Thank you.

ssborbis commented 1 month ago

I'll have to look into how a browser handles default engines. What browser are you using BTW so I can check?

ssborbis commented 1 month ago

Assuming you're using a chrome variant, I made a push to the master branch.

image

chrome://<this extension id>/searchbar.html?q=%s where <this extension id> is the string shown in the URL bar when you open CS Options

ssborbis commented 1 month ago

The new code uses the first non-folder node as the search engine. This code will need some modification before release, but it's a good place to start testing.

Sagitee commented 1 month ago

Hi ssborbis and thanks a lot for looking into this. I mainly use kiwi, a chromium mobile browser and also FF on windows. I installed the new push on FF and Iron desktop and on kiwi android, but

chrome-extension://<this extension id>/searchbar.html?q=myterms or moz-extension://<this extension id>/searchbar.html?q=myterms

opens the CS ToolBar menu, just like when opening on previous versions

chrome-extension://<this extension id>/searchbar.html

without making a search with the first non-folder search engine (and without transferring “myterms” in the CS ToolBar menu search field for additional manual searches). Shouldn’t that work before we test setting it as any browser’s search engine? In any way, the same happens on FF or on Iron browser where I set it as a (default) search engine.

Thank you.

ssborbis commented 1 month ago

What is the first thing in your search engines list?

I've tested on chromium and firefox using the this url directly chrome-extension://<this extension id>/searchbar.html?q=myterms does the following:

  1. opens a new blank tab to searchbar.html
  2. quickly redirects to https://duckduckgo.com/?q=myterms&ia=web since I have DDG as the first engine in my list

FYI, visiting chrome-extension:///searchbar.html without a search query will only bring up a poorly formatted CS toolbar menu

Sagitee commented 1 month ago
  1. opens a new blank tab to searchbar.html
  2. quickly redirects to https://duckduckgo.com/?q=myterms&ia=web since I have DDG as the first engine in my listDDG as the first engine in my list

I tested it again without success (no "redirection" step 2) on Iron browser with the CS push default settings and after setting DDG as the first engine in the list and moving the CS QM tools to the bottom under the search engines.

I noted some errors in the extensions screen so I'm attaching some print screens.

Thank you.

a01 a02

a03

ssborbis commented 1 month ago

Hmm... are you sure you're on the latest code in the master branch? I'll double-check my last push went through.

Going to image

should stop loading the page before the menu displays if there's a query string in the URL

Sagitee commented 1 month ago

are you sure you're on the latest code in the master branch?

I had used this link

https://github.com/ssborbis/ContextSearch-web-ext/archive/refs/heads/development.zip

that you had once provided me. In the extensions CS card (above printscreen) showed

ContextSearch-web-ext 1.47.0

I now understand that by master branch you meant the zip of this link

https://github.com/ssborbis/ContextSearch-web-ext/archive/refs/heads/master.zip

which I used and now the extensions CS card reads

ContextSearch-web-ext 1.46.26

So

chrome-extension://<this extension id>/searchbar.html?q=myterms

finally works.

The opening of the searchbar.html is not visible but, as you mentioned, it now redirects (after about three seconds) to the first engine in CS SE list, searching for myterms.

Could that redirection be optional, so as the searchbar.html to just open (with myterms transferred in its search field) and to let the user make a normal CS search by clicking on any desired SE tile?

Thank you.

ssborbis commented 1 month ago

It will take some work to get the searchbar.html page to look nice. I'll let you know when anything is worth testing.