Fix the issue that add-on doesn't work 22/187022/2
authorjaekuk, lee <juku1999@samsung.com>
Fri, 17 Aug 2018 08:31:15 +0000 (17:31 +0900)
committerjaekuk lee <juku1999@samsung.com>
Fri, 17 Aug 2018 08:32:02 +0000 (08:32 +0000)
- Define noExtensions of options
- Don't create WebApplication class when launching Electron app

Change-Id: I0dfb8b1d33c66c3da956e8da307499ee980badac
Signed-off-by: jaekuk, lee <juku1999@samsung.com>
tizen/src/browser/api/wrt_api_core.cc [changed mode: 0644->0755]
wrt/src/main.js [changed mode: 0644->0755]
wrt/src/runtime.js

old mode 100644 (file)
new mode 100755 (executable)
index 5c87593..e58d525
@@ -90,6 +90,8 @@ bool WebRuntime::isTizenWebApp() const {
 
 bool WebRuntime::isElectronLaunch() const {
   auto app_data = common::ApplicationDataManager::GetCurrentAppData();
+  if (!app_data)
+    return false;
   return app_data->IsElectronApp();
 }
 
old mode 100644 (file)
new mode 100755 (executable)
index b84ef59..d00a8c4
@@ -29,6 +29,7 @@ let parseCommandLine = function() {
     options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.');
     options.alias('p', 'path').string('p').describe('p', 'Set contents path to load');
     options.alias('s', 'window-size').string('s').describe('s', 'Set the window size');
+    options.alias('E', 'no-extensions').boolean('E').describe('E', 'Do not load extensions');
     let args = options.argv;
     if (args.help) {
         process.stdout.write(options.help());
@@ -39,7 +40,8 @@ let parseCommandLine = function() {
         appID: args.a,
         devMode: args.d,
         path: args.p,
-        windowSize: args.s
+        windowSize: args.s,
+        noExtensions: args.E
     };
 };
 
index 1c13e826b7e63f2748385fdaa238862129869564..c4813c9df0bee631331da98930de912299f15c2f 100755 (executable)
@@ -60,9 +60,12 @@ class Runtime {
         app.once('ready', function(event) {
             runtime_debug('ready');
             _this.extensionManager = new ExtensionManager(EXTENSIONS_PATH);
-             if (!options.noExtensions) {
+            if (!options.noExtensions) {
                 _this.extensionManager.build();
             }
+            if (wrt.isElectronLaunch()) {
+                return;
+            }
             _this.webApplication = new WebApplication(options);
         });
         wrt.on('start-app', function() {