Fix WebApp crash with installed extension on TV (multiprocess) 23/184923/2
authorws29.jung <ws29.jung@samsung.com>
Tue, 24 Jul 2018 09:01:22 +0000 (18:01 +0900)
committerjaekuk lee <juku1999@samsung.com>
Wed, 25 Jul 2018 00:19:01 +0000 (00:19 +0000)
Earlier then this patch, there was fix up patch for same issue
but only applied with Tizen WebApp. (d8c2683)
This patch moves extension activation on 'browser-window-created' callback
so now BrowserWindow construction is guaranteed before activation for
both Tizen and Electron Web App type.

Change-Id: I94405ead5ef6188da09faaac91f976307fae3a3b
Signed-off-by: ws29.jung <ws29.jung@samsung.com>
wrt/src/runtime.js

index a49487d2918f2d6e7d6fbaad15f69490fe67e85e..ae01bb3584e6b906665f6f86d9d9e58fd807838a 100755 (executable)
@@ -42,6 +42,10 @@ class Runtime {
             return runtime_debug('browser-window-focus');
         });
         app.on('browser-window-created', function() {
+            if (!_this.isLaunched) {
+                _this.extensionManager.activateAll(app);
+                _this.isLaunched = true;
+            }
             return runtime_debug('browser-window-created');
         });
         app.on('gpu-process-crashed', function() {
@@ -70,11 +74,9 @@ class Runtime {
                 _this.extensionManager.build();
             }
             if (wrt.isElectronLaunch()) {
-                _this.extensionManager.activateAll(app);
                 return;
             }
             _this.webApplication = new WebApplication(options);
-            _this.extensionManager.activateAll(app);
         });
     }
     onPause(web_window_id) {