From: hyunduk.kim Date: Tue, 16 Apr 2019 02:37:37 +0000 (-0700) Subject: Checking the emptiness of addon lists X-Git-Tag: submit/tizen/20190423.011818~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a89f5fe70dfba7877b6e3c8d57a363268050731;p=platform%2Fframework%2Fweb%2Fwrtjs.git Checking the emptiness of addon lists 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 --- diff --git a/wrt_app/src/extension_manager.js b/wrt_app/src/extension_manager.js index 293a3275..34884282 100755 --- a/wrt_app/src/extension_manager.js +++ b/wrt_app/src/extension_manager.js @@ -334,7 +334,7 @@ class ExtensionManager { } isAddonAvailable() { - return this.extensions_ != null; + return Object.keys(this.extensions_).length != 0; } static getManifestFile() { diff --git a/wrt_app/src/web_application.js b/wrt_app/src/web_application.js index 863774ec..1af967f0 100755 --- a/wrt_app/src/web_application.js +++ b/wrt_app/src/web_application.js @@ -49,7 +49,7 @@ class WebApplication { fullscreen: false, show: false, webPreferences: { - nodeIntegration: false, + nodeIntegration: options.isAddonAvailable, nodeIntegrationInWorker: false }, 'web-preferences': {