arjun
arjun

Reputation: 103

How can I add a context menu to a browser action with a Chrome extension?

So what I'm trying to do is sort of like the "Search Google" context menu option that is already there. only I would like to view the result of this in a browser extension. Is this possible in any way?

Upvotes: 1

Views: 1160

Answers (1)

Xan
Xan

Reputation: 77482

You are asking whether it's possible to add your own entry to the menu where "Search Google" appears.

Yes, it is possible.

The docs are here: https://developer.chrome.com/extensions/contextMenus

There are also samples available.

I would suggest putting logic in a background page, since popup does not persist and can't have a listener for this event. Then, the popup should request data from the background page as needed.

Upvotes: 3

Related Questions