ssborbis / ContextSearch-web-ext

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

Display text search Engines when links triggered #543

Closed wordpure closed 1 year ago

wordpure commented 2 years ago

Context Search supports pressing Ctrl to switch the trigger object of Links to url or text, but when I trigger the quick menu of the link, it will not display the text search engine.

Whether it is possible to display text search engines when triggering links. Or even further, depending on the settings of General, and whether the user pressed Ctrl, intelligently switch the filter to 'selection' or link?

图片

图片

ssborbis commented 2 years ago

Makes sense. I'll look into it.

ssborbis commented 2 years ago

Fixes in the development branch.

There were some changes to the context menu code too that needs some additional testing before I can push a new release.

wordpure commented 1 year ago

This issue is fixed in Firefox extension version 1.44.1.

Thank you very much.

wordpure commented 1 year ago

@ssborbis

If the link is triggered through the right-click menu instead of quick menu, it will still only display the link search engine😂

wordpure commented 1 year ago

In addition, I found that when the context menu is activated on an image, the ContextSearch's menu item hotkeys move from the first level to the second level.

图片

I guess this may be because the image contains both link and image contexts. But I can't find another element that belongs to both contexts, so I can't verify it.

wordpure commented 1 year ago

But I can't find another element that belongs to both contexts, so I can't verify it.

This also happens with ContextSearch when link text is selected, so the problem is most likely related to multiple contexts.

图片

If the link is triggered through the right-click menu instead of quick menu, it will still only display the link search engine😂

Isn't the context menu of "select link text" and "trigger directly on link" activated in reverse?

We usually select link text to search or copy the selected text. Wouldn't it be better not to show the link context menu?

ssborbis commented 1 year ago

f the link is triggered through the right-click menu instead of quick menu, it will still only display the link search engine

I'm still working this out. The context menu API is not great.

In addition, I found that when the context menu is activated on an image, the ContextSearch's menu item hotkeys move from the first level to the second level.

Another API issue. In the event of multiple menus ( link + selection ), a parent menu is automatically created that I have no control over.

We usually select link text to search or copy the selected text. Wouldn't it be better not to show the link context menu?

Probably, but I can't always anticipate how users expect things to work.

ssborbis commented 1 year ago

I have some fixes for the context menu in the development branch for testing.

ssborbis commented 1 year ago

Go ahead and close if this was fixed. Otherwise, please let me know what's still broken and I'll try to clear it up before the next release. TBH, I rarely use the Context menu, so I don't get exposed to the bugs like another user might.

wordpure commented 1 year ago

If the link is triggered through the right-click menu instead of quick menu, it will still only display the link search engine😂

In addition, I found that when the context menu is activated on an image, the ContextSearch's menu item hotkeys move from the first level to the second level.

图片

These two issues remain in 1.46b3.

ssborbis commented 1 year ago

Ok, I think this is worked out now. If an image has a link associated, the menu will only show either the link or image context, not both, depending on whether you're holding CTRL when the menu is opened. Defaults to image, but I can add a setting for that later. Code is in the dev branch.

wordpure commented 1 year ago

In 1.46.3, Ctrl can be used to toggle whether the link displays the link context menu or the text context menu, but the text context menu only displays the search link text, and the submenu item is still the link search engine.

图片

图片

The image press Ctrl to switch the context menu behaves normally, expect to see it in General with a links-like setting.

图片

ssborbis commented 1 year ago

In 1.46.3, Ctrl can be used to toggle whether the link displays the link context menu or the text context menu, but the text context menu only displays the search link text, and the submenu item is still the link search engine.

To be clear, the problem is, when opening the context menu on a link and getting LINK TEXT, the engines displayed in the submenu are associate with the link context instead of the selection context?

but the text context menu only displays the search link text

Is there another problem here? I'm able to get link or link text depending on whether I'm holding CTRL. Is that not the case for you?

ssborbis commented 1 year ago

v1.46.4 going up. Give that a shot and see if the problems you're seeing are fixed.

wordpure commented 1 year ago

To be clear, the problem is, when opening the context menu on a link and getting LINK TEXT, the engines displayed in the submenu are associate with the link context instead of the selection context?

Yes, that's exactly what I'd like feedback on.

Is there another problem here? I'm able to get link or link text depending on whether I'm holding CTRL. Is that not the case for you?

What I want to express is that when the context menu of the link text is activated, although the first-level menu of Content Search displays Search for LINK TEXT, the submenu still displays the search engine of the link context instead of the selection context.

This sentence is just a further description of the current problem, but my English level is not good, and the translation into English with the help of machine translation has brought misunderstandings😂

v1.46.4 going up. Give that a shot and see if the problems you're seeing are fixed.

The problem is solved after the update, thanks。

ssborbis commented 1 year ago

This sentence is just a further description of the current problem, but my English level is not good, and the translation into English with the help of machine translation has brought misunderstandings

Most users who post issues here are not native English speakers and also use translation software. Describing technical problems can be difficult when there is a language barrier, and sometimes I need clarification to be certain I understand the issue fully. I appreciate the explanation.