6

how to open default_popup on contextmenu item click in chrome extension

is there anyway? when user click on context menu item than we can call/open html file which define in default_popup for browser action.

I have already go through on the following links. there answer was no (any possible way). if no what do I do to achieve this any alternative?

how-to-open-the-default-popup-from-context-menu-in-a-chrome-extension
how-can-i-open-my-extensions-pop-up-with-javascript

Community
  • 1
  • 1
huda
  • 4,107
  • 2
  • 21
  • 24

1 Answers1

3

The Google Chrome developer team has stated that this feature will not be added in a feature request:

The philosophy for browser and page action popups is that they must be triggered by user action.

An alternative would be to open the Popup.html file in a new tab using the following code or something similar

Note: Needs to be called from background page and requires the "tabs" permission

// Opens Popup.html in new tab
chrome.tabs.create({'url': chrome.extension.getURL('popup.html')}, function(tab) {
  // Tab opened.
});
Tidal5
  • 110
  • 1
  • 12