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 293a327..3488428 100755 (executable)
@@ -334,7 +334,7 @@ class ExtensionManager {
     }
 
     isAddonAvailable() {
-        return this.extensions_ != null;
+        return Object.keys(this.extensions_).length != 0;
     }
 
     static getManifestFile() {
index 863774e..1af967f 100755 (executable)
@@ -49,7 +49,7 @@ class WebApplication {
             fullscreen: false,
             show: false,
             webPreferences: {
-                nodeIntegration: false,
+                nodeIntegration: options.isAddonAvailable,
                 nodeIntegrationInWorker: false
             },
             'web-preferences': {