Skip to content

Commit 7d9a7a2

Browse files
committed
imp: safemode
1 parent 31dfb9c commit 7d9a7a2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/core/entities/App.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ const Modes = {
2121
CRASHED: 'crashed',
2222
}
2323

24+
let safeMode = false
25+
if (typeof window !== 'undefined') {
26+
safeMode = new URLSearchParams(window.location.search).get('safemode')
27+
}
28+
2429
export class App extends Entity {
2530
constructor(world, data, local) {
2631
super(world, data, local)
@@ -121,7 +126,10 @@ export class App extends Entity {
121126
this.root.activate({ world: this.world, entity: this, moving: !!this.data.mover })
122127
// execute script
123128
const runScript =
124-
script && !crashed && (this.mode === Modes.ACTIVE || (this.mode === Modes.MOVING && !this.resetOnMove))
129+
script &&
130+
!crashed &&
131+
!safeMode &&
132+
(this.mode === Modes.ACTIVE || (this.mode === Modes.MOVING && !this.resetOnMove))
125133
// (this.mode === Modes.ACTIVE && script && !crashed) ||
126134
// (this.mode === Modes.MOVING && !this.resetOnMove && !this.scriptError)
127135
if (runScript) {

0 commit comments

Comments
 (0)