Add a flag indicating app is started from default app
authorCheng Zhao <zcbenz@gmail.com>
Fri, 6 May 2016 12:48:51 +0000 (21:48 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 6 May 2016 12:49:49 +0000 (21:49 +0900)
default_app/main.js
docs/api/process.md

index cf71277c19d56c440dd12d9d68df02402fc6731c..2bc1ac7743ae1f8868087f76e5cd9bc2d1795676 100644 (file)
@@ -230,6 +230,9 @@ if (option.modules.length > 0) {
 }
 
 function loadApplicationPackage (packagePath) {
+  // Add a flag indicating app is started from default app.
+  process.defaultApp = true
+
   try {
     // Override app name and version.
     packagePath = path.resolve(packagePath)
index 82680e1e0d731c338119ada468efc99fab4cfe65..ab637e8a2b9eb0121237c2faf2122513a2142b3e 100644 (file)
@@ -14,6 +14,9 @@ upstream node:
   other builds it is `undefined`.
 * `process.windowsStore` Boolean - If the app is running as a Windows Store app
   (appx), this value is `true`, for other builds it is `undefined`.
+* `process.defaultApp` Boolean - When app is started by being passed as parameter
+  to the default app, this value is `true` in the main process, otherwise it is
+  `undefined`.
 
 ## Events