From 23b4bbd13345ecd5c00fda60b995a7fb2aab317c Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 23 Feb 2012 15:08:21 -0800 Subject: Fixing document mode check --- js/controllers/document-controller.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 3a77ed5f..d5d0cf42 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -86,8 +86,12 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // handleAppLoaded: { value: function() { - //Checking for app not to be loaded via http/https to add app only listener - if (window.location.protocol !== 'http:' && window.location.protocol !== 'https:') { + //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