'What API should I use for accessing the selected text of the "copy" menu item inside the menu context API?

I am building a web extension on chrome using the contextMenu API.

I have referred this doc - https://developer.chrome.com/docs/extensions/reference/contextMenus/ to use contextMenu API. This doc does not tell how to display already existing menu items. Here I am not able to access the data selected from the existing "copy" menu item from the context menu.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source