ssborbis / ContextSearch-web-ext

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

The default selected context when creating a new search engine #561

Closed wordpure closed 1 year ago

wordpure commented 1 year ago

Currently the default selected context for ContextSearch is selection, which is helpful in most cases. But when we added other context search engines in bulk, we had to manually cancel it.

Is it possible to add an option to allow users to customize the context object that is selected by default when adding a search engine, I think it can bring greater maneuverability.

ssborbis commented 1 year ago

But when we added other context search engines in bulk, we had to manually cancel it.

How are you adding engines in this case?

Is it possible to add an option to allow users to customize the context object that is selected by default when adding a search engine, I think it can bring greater maneuverability.

Sure. I'm curious what context you're using most and why it isn't selection. It's always interesting to hear how this addon is being used.

wordpure commented 1 year ago

I'm curious what context you're using most and why it isn't selection. It's always interesting to hear how this addon is being used.

selection should be the context I use the most, but in the following cases, I need the ability to switch the default context.

  1. I have some search engines with multiple contexts that I have accumulated and collected from others, and I have not imported ContextSearch. With this feature, I can sort them by context and import them. For example, first change the default context to image, then add image context search engines uniformly, then switch the default context to page/frame, and add another type of search engine...
  2. I had an idea today to try opening some commonly used sites using page tiles, and to do that I needed to first add the URLs of those sites to ContextSearch, and cancel the default context added by ContextSearch to prevent them from appearing in other search results after filtering. It was around this time that I suddenly realized that the default addition of seletion could also be a hindrance.
ssborbis commented 1 year ago

I think I understand why you'd want to change the default. I'm still curious to how exactly you're importing in bulk. Are you using a script to convert from one addon to another through the console? If you're doing a tedious import job, give me a little more info and I might be able to give you some console commands to make things easier.

wordpure commented 1 year ago

Thanks for your kind help.

I am planning to migrate some search engines from SearchJumper to ContextSearch. Since the number of them is not very large (less than fifty), and the way SearchJump works is not the same as that of ContextSearch), I prefer to add and set them on the extension's settings page.

图片

图片

ssborbis commented 1 year ago

If you mostly used %s, that would be a pretty straightforward conversion. I don't think it's well documented, but in the templates for this addon ( at least for recent versions ) , %s can be used in place of {searchTerms}

wordpure commented 1 year ago

Thanks for your guide, I found this setting in Advanced. It surprised me.

Not only did it save me having to replace text, but it also reduced the number of characters I had to type later when I manually added a search engine. You know, {searchTerms} is too long as a placeholder.

However, the name of this setting is easy to misunderstand what it does. Maybe it would be better to replace it with search engine placeholder or search engine template param?

图片

wordpure commented 1 year ago

By the way, when adding a search engine, we need to first enter the search engine name in the pop-up window, and then fill in the data through the form.

Is it possible to simplify the steps, automatically focus on the name field of the form when clicking on the add search engine, modify its display text to remind the user, and verify it when submitting?

图片

图片

wordpure commented 1 year ago

Is there an option to control that ContextSearch no longer asks if it is added to the Firefox search engine when it automatically adds a search engine.

图片

ssborbis commented 1 year ago

However, the name of this setting is easy to misunderstand what it does. Maybe it would be better to replace it with search engine placeholder or search engine template param?

That setting is for something else. If you use the Context Menu, without the filtering option, you will see the menu entry labeled something like "Search for FOO with ... ". That setting allows you to change it to say whatever you want, with the character %s representing the current search terms ( FOO in my example ).

Is it possible to simplify the steps, automatically focus on the name field of the form when clicking on the add search engine, modify its display text to remind the user, and verify it when submitting?

Maybe. I'll check the logic. The issue is FF references it's own search engines by name, so duplicate names cause problems. That's initially why a name check is done first, before allowing editing.

Is there an option to control that ContextSearch no longer asks if it is added to the Firefox search engine when it automatically adds a search engine.

No, but I can add it

wordpure commented 1 year ago

That setting is for something else.

I just realized I misunderstood your meaning😂

The current version supports %s instead of {searchTerms} by default, no setting is required.

No, but I can add it

Thank you very much.

ssborbis commented 1 year ago

Is there an option to control that ContextSearch no longer asks if it is added to the Firefox search engine when it automatically adds a search engine.

I'm pretty sure this made it into the previous release. Maybe you've seen the checkbox already.

Is it possible to simplify the steps, automatically focus on the name field of the form when clicking on the add search engine, modify its display text to remind the user, and verify it when submitting?

This may happen in the future, but I'll need to work around some Firefox quirks.

wordpure commented 1 year ago

I'm pretty sure this made it into the previous release. Maybe you've seen the checkbox already.

Very much looking forward to it.

This may happen in the future, but I'll need to work around some Firefox quirks.

Yes, the last few versions have supported adding search engines without asking if they are added to Firefox, I just forgot to give feedback.

图片

Incidentally, twhen the checkbox that is no longer displayed is currently clicked, a pop-up shows the previous enabled/disabled status of the option, which seems unnecessary for the user.

图片

ssborbis commented 1 year ago

Incidentally, twhen the checkbox that is no longer displayed is currently clicked, a pop-up shows the previous enabled/disabled status of the option, which seems unnecessary for the user.

Oops! Left some test code in there. Thanks for the heads up.