3

Is there any way to handle Chrome packaged appWindow active/inactive state? The events something like this onActive or onFocus.

2 Answers 2

3

The AppWindow does not provide this, but the standard DOM window does via window.onfocus and window.onblur.

e.g:

function windowLostFocus() {
  stopPlayingMusic();
}

window.onblur = windowLostFocus;
0

There currently isn't, but there is an API being added right now that will do something close to what you need. Until it's landed, we can't be 100% sure about the final shape, but you will get something along the lines of:

chrome.app.window.isVisible
chrome.app.window.onShown
chrome.app.window.onHidden

...etc.

You can follow the progress in this discussion thread at apps-dev group:

https://groups.google.com/a/chromium.org/forum/#!topic/apps-dev/EZYnJeKI6zw

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.