Checking the emptiness of addon lists 64/203564/1
authorhyunduk.kim <hyunduk.kim@samsung.com>
Tue, 16 Apr 2019 02:37:37 +0000 (19:37 -0700)
committerhyunduk.kim <hyunduk.kim@samsung.com>
Tue, 16 Apr 2019 02:44:14 +0000 (19:44 -0700)
An associate array in JavaScript is not possible to check
its emptiness by the length of the array itself or null.

To resolve it, this patch gets the keys of the array and
check the length of the keys to evaluate the emptiness
of the array.

Change-Id: If460e9690a9ddc39acfbed414f9dca13cc37a8e4
Signed-off-by: hyunduk.kim <hyunduk.kim@samsung.com>
wrt_app/src/extension_manager.js
wrt_app/src/web_application.js

index 293a3275805ddf58fa570471cfdd22c86a53bc11..34884282ac5eda8fb490e4c31c40a67a7034af8a 100755 (executable)
@@ -334,7 +334,7 @@ class ExtensionManager {
     }
 
     isAddonAvailable() {
-        return this.extensions_ != null;
+        return Object.keys(this.extensions_).length != 0;
     }
 
     static getManifestFile() {
index 863774eccda50a40bb08d36dc71d3a0b5e484562..1af967f01f41deb6c70a92c900d66fe9faa4100e 100755 (executable)
@@ -49,7 +49,7 @@ class WebApplication {
             fullscreen: false,
             show: false,
             webPreferences: {
-                nodeIntegration: false,
+                nodeIntegration: options.isAddonAvailable,
                 nodeIntegrationInWorker: false
             },
             'web-preferences': {