diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 3bbb89d1ba..d448f8a6fc 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -171,22 +171,6 @@ define([ }; } - var _finalConstruct = function() { - window.on_native_message('editor:config', 'request'); - if ( !!window.native_message_cmd ) { - for ( var c in window.native_message_cmd ) { - window.on_native_message(c, window.native_message_cmd[c]); - } - } - - native.execCommand('webapps:features', JSON.stringify(features)); - - // hide mask for modal window - var style = document.createElement('style'); - style.appendChild(document.createTextNode('.modals-mask{opacity:0 !important;}')); - document.getElementsByTagName('head')[0].appendChild(style); - }; - var _serializeHeaderButton = function(action, config) { return { action: action, @@ -572,19 +556,21 @@ define([ return nativevars.theme && nativevars.theme.system !== 'disabled'; }, finalConstruct : function() { - window.on_native_message('editor:config', 'request'); - if ( !!window.native_message_cmd ) { - for ( var c in window.native_message_cmd ) { - window.on_native_message(c, window.native_message_cmd[c]); + if (!!native) { + window.on_native_message('editor:config', 'request'); + if ( !!window.native_message_cmd ) { + for ( var c in window.native_message_cmd ) { + window.on_native_message(c, window.native_message_cmd[c]); + } } + + native.execCommand('webapps:features', JSON.stringify(features)); + + // hide mask for modal window + var style = document.createElement('style'); + style.appendChild(document.createTextNode('.modals-mask{opacity:0 !important;}')); + document.getElementsByTagName('head')[0].appendChild(style); } - - native.execCommand('webapps:features', JSON.stringify(features)); - - // hide mask for modal window - var style = document.createElement('style'); - style.appendChild(document.createTextNode('.modals-mask{opacity:0 !important;}')); - document.getElementsByTagName('head')[0].appendChild(style); } }; };