I\'m developing an extension in Chrome, and there\'s a problem. In my inject.js, I make a request like:
chrome.extension.sendRequest({command:
If the message handling is in a pop-up window or html page that is not always visible, before I send any message, I check if the pop-up is visible, like so:
function isPopupVisible() { //required for firefox before sending any message ore we get the stupid message 'receiveing end does not exist'
var views = chrome.extension.getViews({ type: "popup" }); //https://stackoverflow.com/questions/8920953/how-determine-if-the-popup-page-is-open-or-not
if (views.length > 0) {
console.log("Popup is visible");
return true;
}
return false;
}