javascript - Chrome extension window listener - on minimized -
javascript - Chrome extension window listener - on minimized -
i'm creating little chrome extension, , having problem figuring out should check whether window minimized or not.
so far using chrome.tabs.onactivated , chrome.tabs.query hear tab alter , works expected, problem need know when browser window minimized.
chrome.tabs.onactivated.addlistener(function() { chrome.tabs.query({currentwindow: true, active: true}, function(tabs){ //do }); });
i have looked @ onfocuschanged seems work multiple browser windows.
how check browser window minimized?
it's easy if have window id, can window object:
chrome.windows.get(windowid, function(win){ if(window.state == "minimized") { /* ... */ } });
if need current window, utilize getcurrent
instead:
chrome.windows.getcurrent(function(win){ if(window.state == "minimized") { /* ... */ } });
javascript google-chrome-extension
Comments
Post a Comment