From 41b69af7c0be3dd5fe4f772668862696af8b917a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 23 Feb 2012 15:07:28 -0800 Subject: Fixing app mode check. Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index fa611de4..1c9d9d59 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -84,8 +84,13 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // handleAppLoaded: { value: function() { - //Adding an intercept to resources loaded to ensure user assets load from cloud simulator - if (window.chrome.app.isInstalled) { + //Checking for app to be loaded through extension + var check; + if (chrome && chrome.app) { + check = chrome.app.getDetails(); + } + if (check !== null) { + //Adding an intercept to resources loaded to ensure user assets load from cloud simulator chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: [""]}, ["blocking"]); } } -- cgit v1.2.3