You can use the following chrome API call from your background page if the popup is open:
var views = chrome.extension.getViews({ type: "popup" });
If it returns an empty array, your popup will not be open, if it returns an array with your DOMWindow object, then the popup is open.
, DOMWindow .