What is the best way to show a sidebar/popup window on a context menu item click?

前端 未结 2 1819
予麋鹿
予麋鹿 2021-01-25 23:50

Problem

I want to show a popup window or a sidebar window on webpages when the user clicks on a Context Menu item(which I create through my extension ba

2条回答
  •  死守一世寂寞
    2021-01-26 00:12

    The default popup is only shown after the user clicked on the browser action icon.

    If you like to use a context menu item you cannot use Chrome's default popup (https://bugs.chromium.org/p/chromium/issues/detail?id=30491). That means you have to come up with another solution to inject HTML code for the user interface in the current web page. One reasonable approach is to inject an iframe. By using an iframe you can recreate an interface like that one you show in the gif.

提交回复
热议问题