Make benchmark work on native
This commit is contained in:
@@ -92,9 +92,11 @@ export const browser_platform: Platform = {
|
||||
return localStorage;
|
||||
},
|
||||
on_shown(shown) {
|
||||
document.addEventListener("visibilitychange", () => {
|
||||
const listener = () => {
|
||||
if (!document.hidden) shown();
|
||||
});
|
||||
};
|
||||
document.addEventListener("visibilitychange", listener);
|
||||
return () => document.removeEventListener("visibilitychange", listener);
|
||||
},
|
||||
// sprinting is ctrl and walking is w, and ctrl+w closes the tab without the page getting a say. in fullscreen
|
||||
// the keyboard lock catches it instead (see browser_input.ts)
|
||||
|
||||
Reference in New Issue
Block a user