mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +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);
|
$tw.boot = $tw.boot || Object.create(null);
|
||||||
|
|
||||||
// Detect platforms
|
// Detect platforms
|
||||||
$tw.browser = typeof(window) !== "undefined" ? {} : null;
|
if(!("browser" in $tw)) {
|
||||||
$tw.node = typeof(process) === "object" ? {} : null;
|
$tw.browser = typeof(window) !== "undefined" ? {} : null;
|
||||||
$tw.nodeWebKit = $tw.node && global.window && global.window.nwDispatcher ? {} : 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
|
// Set default boot tasks
|
||||||
$tw.boot.tasks = {
|
$tw.boot.tasks = {
|
||||||
|
Loading…
Reference in New Issue
Block a user