dessant / search-by-image

Browser extension for reverse image search, available for Chrome, Edge and Safari
https://apps.apple.com/us/app/search-by-image-for-safari/id1544552106
GNU General Public License v3.0
2.28k stars 200 forks source link

Show context menu items on extension pages #195

Closed neoOpus closed 2 years ago

neoOpus commented 2 years ago

Hi Armin

I hope you are doing great,

I just found out that the extension doesn't work on this sort of address extension://cnojnbdhbhnkbcieeekonklommdnndci/src/view/index.html?id=

Some other extension do.

dessant commented 2 years ago

Hi @neoOpus :yum:, the extension is not shown in the context menu because we cannot inject a content script in the page of another extension. There is some limited use for adding it to access images that are also recognized by the browser as images when you open the context menu.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/OnClickData

The extension already uses the srcUrl from the context menu event if injecting scripts in the page is not allowed, so we would only need to expose the extension in the context menu.

Please share an extension you would use this feature with for testing.

neoOpus commented 2 years ago

You are right, excuse my ignorance, I am aware that there are many security limitations, but I don't have a grasp of them as a dev does

dessant commented 2 years ago

This change will also let us use the context menu on our own extension pages, such as the confirmation popup that is shown when multiple images are detected.

neoOpus commented 2 years ago

Amazing as usual 👍🏼