yimingliu / reverse-image-search-safari

Safari app extension for reverse image search
BSD 3-Clause "New" or "Revised" License
57 stars 6 forks source link

"Select Image with ..." always uses the last engine in list on Safari 17 #27

Closed kyleerhabor closed 1 year ago

kyleerhabor commented 1 year ago

Hello,

I'm using this extension on Safari Technology Preview 172 (like Safari 17) and noticing that, regardless of which search button I use, it always uses the last one listed. This doesn't appear to happen on Safari 16, which is interesting.

A demo:

https://github.com/yimingliu/reverse-image-search-safari/assets/40676441/a4ce7ecc-d8de-4951-93e8-cf1bfa6be547

yimingliu commented 1 year ago

Thank you for the report! Yes, I can reproduce this issue with Safari Tech Preview. Very strange -- will look into it in more detail this weekend

yimingliu commented 1 year ago

So, it turns out that it is Safari Technology Preview 17.0 that is sending the last menu item regardless of what menu item is selected. This happens even in a freshly created test app extension, with two test menu items. Selecting any of the items will send a contextMenuItemSelectedWithCommand callback with command parameter set to the last menu item.

This feels like an Apple bug to me. Unfortunately there is no easy workaround from this end, given that we have to rely on the callback from Safari to know what menu item was selected. I've filed a developer support ticket with Apple to ask for advice. In the mean time...I hope they don't ship Technology Preview as release version in the near future.

yimingliu commented 1 year ago

Developer Support suggests this is a Safari bug. I've filed it as FB12419231 in Feedback Assistant.

Let's hope it doesn't get shipped live.

kyleerhabor commented 1 year ago

Awesome. Hope it doesn't ship either 👍

yimingliu commented 1 year ago

There is a new Safari Technology Preview made available today -- I can no longer reproduce the above problem in this latest version. Can you try it again with the latest release?

kyleerhabor commented 1 year ago

I just tried it, and can't reproduce it either. Seems to work now 🙂

yimingliu commented 1 year ago

FWIW nobody ever responded to my ticket in Feedback Assistant, as is typical of Apple.

But seeing as the presumed bug is resolved on Apple's end, I will close this issue. Feel free to open another issue if the problem re-emerges.