Does this work if it's attached to `visibilitychange` on `window`?