ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
321 stars 36 forks source link

On/off option for the Quick Menu #576

Open Sagitee opened 1 year ago

Sagitee commented 1 year ago

Hi Ssborbis,

Once more thanks for the wonderful ContextSearch-web-ext. I hope you are fine.

The Quick Menu opening methods trigger these two functions:

Common actions like selection, clicking on or dragging of text, links or images are very common or necessary to accomplish various tasks in everyday browsing. So, the enabling of some of the opening methods, while very effective when the user is in need of the QM, becomes very annoying when he wants to achieve some other task.

I would suggest the opening function of each of those methods to be optional. e.g. by replacing the Enable check box with a three options list:

In this way, it would be possible:

Or, by having two separate Enable check boxes/options for the Open and the Copy Text functions, it would also be possible:

ssborbis commented 1 year ago

If I understand correctly, you'd like to use the auto copy function ( on some opening methods ), but not necessarily open the menu?

Have you tried setting a modifier key with your opening method? For instance, if you enabled CTRL on the 'Auto' opening method, your mouse actions would work normally when NOT holding CTRL, and auto-copy the text you select, but would only trigger the QM when holding CTRL.

edit:

To just open the QM with a blanc field, in order to type some custom text to be searched for.

Are you running into an issue of your clipboard being overwritten when you really just want to open the qm?

Sagitee commented 1 year ago

Thank you for your answer.

auto copy function

No. By "copy" I meant the transfer of the selected, clicked etc. text to the QM search field (if the QM is already open), not to the clipboard.

Are you running into an issue of your clipboard being overwritten when you really just want to open the qm?

No. Before typing and searching for an arbitrary text I have not only to open the QM, but also to cause the unwanted transfer of some text of the web-page to the QM search field and then to select-delete it.

Furthermore, when I don’t need the QM, I have to open it so as to click on the Disable Menu tool. If I’ll later need it again, I’ll have to refresh the page so as to re-enable it again.

May be a better solution to address these issues is an option of one (or two) overlaying button(s) - icon(s) (like that of the CS Sidebar) for the re-enabling (and reopening) of the QM.

ssborbis commented 1 year ago

I'm trying to get an idea of your workflow, so bear with me. It might be helpful to walk me through a scenario that is problematic for you. I'm not opposed to additional settings. I just need to get a better idea of how they should work.

Before typing and searching for an arbitrary text I have not only to open the QM, but also to cause the unwanted transfer of some text of the web-page to the QM search field and then to select-delete it.

Have you tried setting a shortcut for the QM under CS options -> Shortcuts. That would open the QM without search terms ( provided you're not currently selecting text ).

then to select-delete it

You can set the QM search field to select the text in the search bar and give the search bar focus after opening the QM. Then you just start typing and the text is replaced. There's no additional steps of selecting / deleting.

Sagitee commented 1 year ago

Thanks for the suggestions.

I use CS both on my mobile (Kiwi browser) and on my PC (FF).

On the mobile, keyboard input for commands is not a good case (even if it could be possible). But the Search field Selection-Focus can be a solution.

On the PC I’ll use your Shortcut fix. …but in the future. For the time I am stuck at CS Version 1.21.1 (Shortcuts option is a newer CS feature) because on later versions, 2-3 necessary for me CS features had stopped working properly. I may make an additional issue concerning them. I temporarily installed V. 1.45.4 to test it and I think that the Shortcut fix is a good option.

In one or other way these fixes are addressing the issue of the arbitrary text search.

So, my main remaining and more important issue or wanted feature is:

A way (preferably a mouse - not keyboard action):

an idea of your workflow

Most of the time I use QM to make several (e.g. 5-20) consecutive searches (mainly on dictionary-translation sites), and this may be repeated several (e.g. 3-10) times each day. I mainly use the mouse (Simple Click for one or two words searches and Mouse select + Hold Right Button for more words’ searches).

ssborbis commented 1 year ago

to disable QM without having previously to open it (so as to use the Disable Menu tool) and to re-enable it without having previously to refresh the web page

I can think of a few options that might work

  1. having an optional menu in the context menu with checkboxes for toggling common CS features
  2. overlay an icon somewhere on the webpage that opens a menu to turn features on / off
  3. allow the 'disable' tool to work from the toolbar menu (browser_action) for the current tab and make the tool an on / off switch

For the time I am stuck at CS Version 1.21.1 (Shortcuts option is a newer CS feature) because on later versions, 2-3 necessary for me CS features had stopped working properly

I'd be interested in knowing what these are

ssborbis commented 1 year ago

Most of the time I use QM to make several (e.g. 5-20) consecutive searches (mainly on dictionary-translation sites), and this may be repeated several (e.g. 3-10) times each day. I mainly use the mouse (Simple Click for one or two words searches and Mouse select + Hold Right Button for more words’ searches).

It was never fully fleshed out, but the repeat search tool (set to menuless) is a great solution for multiple dictionary / translations from a single page. The idea is, you open the qm, enable the tool, and perform a search with a mouse / key combo that sends results to the sidebar. Then, every subsequent action that would normally open the qm simply repeats the last search with the new search terms. Meaning, you keep simple-clicking words on a page, and the results are loaded into the sidebar for easy readability. No menu needed, no clicking the same engine again. The problem it had was turning it off, or even knowing it was turned on. I've since added Esc as a means of disabling it, I need to add a visual aide as well. Anyway, something to think about. When configured properly, it's a timesaver.

ssborbis commented 1 year ago

Looks like the Instant Search / Repeat Search tool needs a bit of work, but I'll clean it up for the next release.

Sagitee commented 1 year ago

I can think of a few options that might work

I am keen for the second one but I can’t see why an additional level of menu is necessary. Wouldn’t be enough an icon like that of the CS Side Bar, which when clicked would disappear after having opened and enabled the QM, and which would reappear after the user had pressed either the Close menu or the Disable menu tool.

the repeat search tool (set to menuless) is a great solution

While I always have the Instant Search and the Open in the Side Bar options enabled (not on my mobile of course), I have never set it to menuless since for the most of the words, I make searches in various sources (by “consecutive searches” and “repeated several times” I didn’t mean on the same Search Engine) that have different advantages and scope of expertise (definitions, translation, pronunciation, etymology, example phrases etc.) On the contrary, I always have the “Lock menu open” tool enabled, even if as the current issue suggests, I need an additional handy way to disable-re-enable the QM for the periods when I’ll not use CS.

I'd be interested in knowing what these are

The only feature I can notice that works in version 1.21.1 but not in the current one is the Simple Clicking on terms in the FF Side Bar: The QM is not opening. If it is already open its text field is not updated and there is no search. (The following two issues that I had noticed in version 1.23 and 1.27 seem to be fixed in the current version: Even if the Lock menu open and the Advanced/…Lock.Persist options were enabled, a) sometimes QM was closing by clicking somewhere in the page b) QM was “refreshed” on each searching with an opening method)

ssborbis commented 1 year ago

I am keen for the second one but I can’t see why an additional level of menu is necessary. Wouldn’t be enough an icon like that of the CS Side Bar, which when clicked would disappear after having opened and enabled the QM, and which would reappear after the user had pressed either the Close menu or the Disable menu tool.

I'm looking more into a status bar that can hold multiple icons representing various CS options.

image

The only feature I can notice that works in version 1.21.1 but not in the current one is the Simple Clicking on terms in the FF Side Bar: The QM is not opening.

I doubt the content scripts are being injected into the sidebar anymore. It's almost a fluke that they ever did. That API is not very robust and some things work or don't purely by accident vs design.

ssborbis commented 1 year ago

I'm trying to bring back some of the qm functions to the sidebar, but it's exceeding difficult to troubleshoot. It may not be feasible with the newer code, but I'll spend a bit more time on it.

Sagitee commented 1 year ago

I'm looking more into a status bar that can hold multiple icons representing various CS options.

It seems more suitable and promising.

ssborbis commented 1 year ago

latest push to the dev branch has hidden option showStatusBar.

The only function right now is QM on / off

Peek 2022-10-06 16-41

Sagitee commented 1 year ago

Thank you very much. I tested it on FF. I don’t know how to test it on Kiwi (Chromium) browser on my mobile. It’s very nice. I would only suggest an additional option (maybe in the advanced settings) for its default value (on/off) on newly opened tabs/windows. Now, enabling QM in the settings enables QM on all newly opened tabs/windows (otherwise it totally disables QM (and the Status Bar).

ssborbis commented 1 year ago

I would only suggest an additional option (maybe in the advanced settings) for its default value (on/off) on newly opened tabs/windows.

Now, enabling QM in the settings enables QM on all newly opened tabs/windows (otherwise it totally disables QM (and the Status Bar).

I had set up the button to temporarily disable the qm in that particular tab, leaving the global qm on / off setting untouched. I can do it the other way, where it's a global setting affecting all tabs and sessions. Is that what you want?

Sagitee commented 1 year ago

I had set up the button to temporarily disable the qm in that particular tab, leaving the global qm on / off setting untouched. I can do it the other way, where it's a global setting affecting all tabs and sessions. Is that what you want?

No, I like very much the current “per tab” on/off switch. I think that the global switch should henceforth refer to the default-initial value of the per tab switch. In that way: If the global switch is turned on, everything will function as functions now. But if it is turned off, the Status Bar will still be visible and functional, with the per tab switch initially (on any newly opened tab) turned off.

ssborbis commented 1 year ago

If the global switch is turned on, everything will function as functions now. But if it is turned off, the Status Bar will still be visible and functional, with the per tab switch initially (on any newly opened tab) turned off.

I'm going to try a separate setting quickMenuDisabledInNewTabs. It sets the initial enabled / disabled status of the qm. Combined with the status bar, you can turn the qm on and off on a per-tab basis, but all new tabs start with that value ( on or off ). I can't use the global Enable Quickmenu setting for this stuff, because that setting determines whether the code to use the qm is injected into web pages or not at load. It's better to inject the code, but disable the qm vs globally disabling the qm. We'll see how it works out.

Sagitee commented 1 year ago

Understood. That will also do the job fine.

ssborbis commented 1 year ago

This feature is live in the latest releases. Test it out and let me know what you think. It's pretty basic, but maybe it could be expanded on an made more useful.

Sagitee commented 8 months ago

Hi,

Please forgive my that much delayed comeback.

It’s very nice! Now, re-enabling (a previously disabled) QM is possible (without having to refresh the page).

Some thoughts:

a separate setting quickMenuDisabledInNewTabs. It sets the initial enabled / disabled status of the qm. Combined with the status bar, you can turn the qm on and off on a per-tab basis, but all new tabs start with that value (on or off)

…would be a necessary complement.

* In the next period of time I could help in improving CS functioning on mobile browsers, if you are interested, as more and more of them implement extensions support, like Kiwi, Mises, Yandex, Lemour, Mozilla Firefox (limited now and fully soon). I use CS most of the time on my mobile and I have spotted some issues, some mobile specific suggestions to make and I could help with relevant testing and feedback.

Thanks again for the amazing ContextSearch-web-ext.