Chrome extension pop up windows always on top
google-chrome, google-chrome-app, google-chrome-extension
Solution
Look at this article: http://www.chromium.org/developers/design-documents/extensions/proposed-changes/apis-under-development/panels
Enable using panels here: chrome://flags/#enable-panels
Here is the code I use to create a panel:
let window_id;
chrome.browserAction.onClicked.addListener(()=>{
if(window_id === undefined){
chrome.windows.create(
{url:'panel.html', type:'panel', focused:true, width:150, height:162}
,_=>window_id = _.id
);
}else{
chrome.windows.update(window_id, {focused:true});
}
chrome.windows.onRemoved.addListener(_=>_ === window_id? window_id = undefined:3);
});
Problem
I've developed a little chrome extension for personal needs. But there's something in the user experience I don't like, the pop-up containing the application automatically closes when it loses the focus. I would like to control the closing behaviour and/or create an always on top popup, I've tried to find my way on Google, Chrome dev forums and API ref but can't find a way to accomplish that.