ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
338 stars 37 forks source link

Multisearch with a single template URL #644

Closed Parvares closed 1 year ago

Parvares commented 1 year ago

Hi Mike, could you help me, please? I'm using this search engine (combobox "Parola chiave"). Is it possible to do a multisearch using a single template URL and using different strings opening multiple tabs? I tried to enable multilinesAsSeparateSearches (value: true), but I don't get any result from the context menu.

P.S. Here are some strings that I used, for example: La moltiplicazione dei pani Alkuin Heising 1970 Architectura in nuce Bruno Zevi 1979 Il ritratto di Dorian Gray Oscar Wilde 1994 La *crisi della psicoanalisi / Erich Fromm 1980

This would be the tamplate URL:

https://opac.sbn.it/risultati-ricerca-avanzata/-/opac-adv/all?struct%3A3008=ricerca.frase%3A4%3D1&fieldstruct%5B1%5D=ricerca.parole_tutte%3A4%3D6&fieldvalue%5B0%5D=%s&fieldaccess%5B0%5D=Keywords%3A1035&fieldop2%5B0%5D=AND%3A%40and%40&fieldstruct%5B10%5D=ricerca.frase%3A4%3D1&fieldop%5B3%5D=AND%3A%40and%40&fieldop%5B1%5D=AND%3A%40and%40&fieldstruct%5B2%5D=ricerca.parole_tutte%3A4%3D6

Thanks very much!

ssborbis commented 1 year ago

For a brief sanity check, does the multi-line search work from the quick menu?

On the topic, I've been thinking a confirm popup would be a good idea for multi-line searches, when enabled. In other words, if you were to do a search on a block of text that had multiple lines, a YesNoCancel box would pop up, asking if you wanted the search to be multi-line ( search each line separately using the same engine ). What do you think?

Parvares commented 1 year ago

No Mike, it doesn't seem working from anywhere... I think it would be better to have the option to activate it when needed from the settings or the context menu without the popup (and perhaps leading/trailing whitespaces should be removed). Thank you!

ssborbis commented 1 year ago

Hmm, ok a few things.

  1. Multi-line search is working for me, as expected, when searching from the context menu
  2. not working from the quick menu
  3. Looks like i already coded a popup menu. The setting multilinesAsSeparateSearchesLimit is the number of lines to search separately before asking for confirmation. In other words, if this is set to 4, then 3 lines won't get a popup, but 5 will ask if you really want to search every line separately
  4. I'm not seeing leading or trailing whitespace in the searches

Please try searching again using the context menu using the example block of lines you provided using these settings multilinesAsSeparateSearches: true multilinesAsSeparateSearchesLimit: 1

and see what happens.

Parvares commented 1 year ago

Thanks, I've changed the limit from 10 to 1, but I don't see any changing from context menu... mumble mumble...

ssborbis commented 1 year ago

Hmm... what browser? Also, it might be useful if you posted your config for me to test. The code seem pretty basic, but maybe there's a conflict I'm not considering.

ssborbis commented 1 year ago

Oh, and did you get a confirm dialog when you tried to search multiple lines? Setting multilinesAsSeparateSearchesLimit: 1 should force it to pop up on every multi-line search.

Parvares commented 1 year ago

Chrome, v. 114. No, I don't get a confirm dialog when I try to search multiple lines. Here are my settings, thanks.

Parvares commented 1 year ago

Hi Mike, do you need something else?

ssborbis commented 1 year ago

Hi Mike, do you need something else?

Nope, I think i'm seeing the issues. I'll post here when I have a fix to test.

ssborbis commented 1 year ago

The potential fix is in the Master branch if you want to try sideloading. It is only intended to fix the quick menu issue.

In chrome variants, it seems the browser removes newlines from selected text when using the context menu. Separate issue I'll try to address later. For now, the QM appears to be working ( in Chromium, at least )

Parvares commented 1 year ago

Thanks, I'll wait an "official" fix for the context menu, thanks again!

ssborbis commented 1 year ago

The context menu appears to be fixed now as well. I'll post here when I get a release out.

ssborbis commented 1 year ago

1.46.11 going up now to chromestore & AMO

ssborbis commented 1 year ago

Reopen if things are buggy. Looks good so far on FF and chromium

Parvares commented 1 year ago

Thank you for your work. The popup opens in both Chrome and Firefox, but after clicking on "ok" the popup does not disappear and often the page freezes and I have to restart the browser... I tried setting different multilinesAsSeparateSearchesLimit

ssborbis commented 1 year ago

Thanks for pointing that out. I'm seeing this too. No idea how that glitch popped up.

ssborbis commented 1 year ago

Should be fixed in 1.46.12, live now

Parvares commented 1 year ago

Thanks Mike, I hope in a soon fix as I'm experiencing some problems with current version (1.46.11): sometimes CS in context menu doesn't react and the fan begins to rotate, forcing me to restart... :(

ssborbis commented 1 year ago

Did you get the update to 1.46.12?

Parvares commented 1 year ago

I don't see it in the store, or do you mean sideloading?

ssborbis commented 1 year ago

Says "Pending Review". I'm going to republish. Sometimes the chromestore hangs on submissions.

Parvares commented 1 year ago

Okay, thank you

Parvares commented 1 year ago

Ehi Mike, I finally used your last version, seems working great so far, thank you very much! I tried copying the strings of the opening post in Google search field, and 4 browser tabs opened, that is what I desired, I don't know how your extension recognized they were separated string although they were joined together!! A question, is it possible let your extension work from Google Sheets (simple or multiline search)?

ssborbis commented 1 year ago

is it possible let your extension work from Google Sheets (simple or multiline search)?

Not currently. I'll need to look at what's possible with the api

Parvares commented 1 year ago

Ah okay, thanks again for your great work!

ssborbis commented 1 year ago

No prob