Disable App Nap via Javascript/HTML
Is there a message that could be sent in a way that at least Safari, if not other browsers, understands that tells Mavericks not to engage App Nap? I have an HTML5 pseudo-MIDI rendering app (i.e., sends individual notes out as mp3 audio) which plays back fine on Safari so long as it's in the foreground, but when focus is lost Safari/OS X does not send back sufficient calling information to play the notes at their appropriate times. What I'd love is something like:
if (window.disallowAppNap !== undefined) {
window.disallowAppNap = true;
}
this.playScore(callbacks = {end: function() {
if (window.disallowAppNap !== undefined) {
window.disallowAppNap = false;
}
} }
);
From a web search, it seems that the answer to this is "Nope," but maybe someone on the OS X or Safari dev. team will see this and think, "that's a great idea!" I've looked through the Web Audio API but can't see anything connecting to App Nap.
Solution 1:
Nope, not currently. JavaScript/HTML can't directly control App Nap in Safari or any other browser on OS X.