mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-06 02:30:46 -08:00
bootprefix: Tighten browser check to include the document global (#8423)
Deno's node emulation can run TiddlyWiki now that it supports the VM isolates API, but the window global exists in that environment, so both browser and node were being detected, causing the autoboot to trip up on nonexistent argv, as the boot was happening in the constructor right before argv was set. Ref: https://github.com/denoland/deno/issues/19286 Ref: https://github.com/flexdinesh/browser-or-node
This commit is contained in:
parent
9069992163
commit
886514aa52
1 changed files with 1 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ $tw.boot = $tw.boot || Object.create(null);
|
|||
|
||||
// Detect platforms
|
||||
if(!("browser" in $tw)) {
|
||||
$tw.browser = typeof(window) !== "undefined" ? {} : null;
|
||||
$tw.browser = typeof(window) !== "undefined" && typeof(document) !== "undefined" ? {} : null;
|
||||
}
|
||||
if(!("node" in $tw)) {
|
||||
$tw.node = typeof(process) === "object" ? {} : null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue