Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to open default_popup on contextmenu item click in chrome extension

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

like image 680
huda Avatar asked Feb 17 '14 12:02

huda


1 Answers

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.
});
like image 180
Tidal5 Avatar answered Oct 05 '22 21:10

Tidal5