How to add custom item to chrome context menu?

Is there any API that will be used to add a custom item to the chrome context menu?

For instance:

Now I want to add the "send ..." element to the context menu (right-click), when it is clicked, the content selected on the web page will be sent to someone.

I searched APIS chrome and found that chrome.experimental.contextMenu is competent according to my requirement, however it is an experimental API, so something like "path_to_chrome.exe --enable-experimental-extension-apis" will be added.

Any other solutions?

+3
source share
2

( ) .

  • manifest.json

    "permissions": ["contextMenus"]
    
  • - :

    chrome.contextMenus.create({
      'title' : 'Open this select text %s',
      'contexts' : ['selection'],
      'onclick' : function(info, tab) {
         console.log('Selected link: ' + info.selectionText);
      }
    });
    

.

+8

contextMenu ( Chromium), API experimental, Google Chrome 6 .

+1

Source: https://habr.com/ru/post/1752389/


All Articles