I have developed a chrome extension that opens a popup when I click on the icon near the address bar. Everything works fine, however I want to add some functionality to it. So I thought I'd also add a context menu item so that the user can simply search for the highlighted word. I want the popup to showup when the user clicks on the item in the context menu(the default popup in the top right corner and not a new popup window or a new tab).
Can I have this functionality? If yes, how do I implement it?
So, to set your popup, you would call it like this: chrome. browserAction. setPopup({popup: "logged_in.
Click the box to the right of the “Extensions Toolbar Menu” option and select “Enabled.” You'll have to relaunch Chrome before your settings take effect. Click the “Relaunch Now” button to restart your web browser. Chrome will reopen all your open tabs, but be sure to save your work first.
You can't make the popup page show programmatically as if the user clicked it.
However, you can still have something display based on the background script / content menu click. There are 4 main options for your background script:
Options 2, 3, 4 will allow the user to stay on their tab without any navigation. The notifications API route is the simplest to use if you just want some quick notification to the user, and there are fewer security snags. 2 and 3 require more book-keeping, but you can make the dialog look like your popup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With