mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 00:50:28 +00:00
Allow callers of the bootprefix to determine browser status
This gives us finer control under node-webkit of whether the core thinks we’re running under the browser or node.
This commit is contained in:
parent
0fdfbc482c
commit
3bbbda0819
@ -20,9 +20,15 @@ $tw = $tw || Object.create(null);
|
||||
$tw.boot = $tw.boot || Object.create(null);
|
||||
|
||||
// Detect platforms
|
||||
$tw.browser = typeof(window) !== "undefined" ? {} : null;
|
||||
$tw.node = typeof(process) === "object" ? {} : null;
|
||||
$tw.nodeWebKit = $tw.node && global.window && global.window.nwDispatcher ? {} : null;
|
||||
if(!("browser" in $tw)) {
|
||||
$tw.browser = typeof(window) !== "undefined" ? {} : null;
|
||||
}
|
||||
if(!("node" in $tw)) {
|
||||
$tw.node = typeof(process) === "object" ? {} : null;
|
||||
}
|
||||
if(!("nodeWebKit" in $tw)) {
|
||||
$tw.nodeWebKit = $tw.node && global.window && global.window.nwDispatcher ? {} : null;
|
||||
}
|
||||
|
||||
// Set default boot tasks
|
||||
$tw.boot.tasks = {
|
||||
|
Loading…
Reference in New Issue
Block a user