Exit media when user closes window (#348)

This commit is contained in:
DC
2016-04-10 16:46:34 -07:00
committed by Feross Aboukhadijeh
parent f8095fcdbf
commit 69460db294
3 changed files with 14 additions and 8 deletions

View File

@@ -34,6 +34,9 @@ LocationHistory.prototype.back = function () {
var page = this._history.pop()
if (page.onbeforeunload) {
// TODO: this is buggy. If the user clicks back twice, then those pages
// may end up in _forward in the wrong order depending on which onbeforeunload
// call finishes first.
page.onbeforeunload(() => {
this._forward.push(page)
})