aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-22 23:28:49 -0800
committerJose Antonio Marquez2012-02-22 23:28:49 -0800
commit950bb79b1907e4f97735bed1430401dfd797fb0d (patch)
treefa3dd99ab94de457555101b108673943c65b8c6d /js
parent3673372c1bf05840cb009aaaa12af31ce665f6ef (diff)
downloadninja-950bb79b1907e4f97735bed1430401dfd797fb0d.tar.gz
App mode checking fix
Added a way to check for the app to be served over http/https to prevent from adding webRequest events on app load.
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 77ae67a1..3a77ed5f 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -86,9 +86,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
86 // 86 //
87 handleAppLoaded: { 87 handleAppLoaded: {
88 value: function() { 88 value: function() {
89 //Adding an intercept to resources loaded to ensure user assets load from cloud simulator 89 //Checking for app not to be loaded via http/https to add app only listener
90 if (window.chrome.app.isInstalled) { 90 if (window.location.protocol !== 'http:' && window.location.protocol !== 'https:') {
91 chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: ["<all_urls>"]}, ["blocking"]); 91 //Adding an intercept to resources loaded to ensure user assets load from cloud simulator
92 chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: ["<all_urls>"]}, ["blocking"]);
92 } 93 }
93 } 94 }
94 }, 95 },