I have a background script that creates a popup window when the extension icon is clicked.
var create = browser.windows.create({
url:popupURL,
type:'popup',
height:500,
width:300,
});
On the popup window, there is a button that, when clicked, minimizes the popup window (called in the popup javascript file):
browser.windows.update(windowInfo.id,{
state:"docked",
focused:false
});
I then execute the content script (called in the popup javascript file):
browser.tabs.executeScript({file: "/content_scripts/recorder.js"})
.then(beginMessage);
But this executes the content script in the popup window. How can I execute the content script in the window that has just been focused when the popup was minimized?