diff options
author | Jose Antonio Marquez | 2012-02-22 23:28:49 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-22 23:28:49 -0800 |
commit | 950bb79b1907e4f97735bed1430401dfd797fb0d (patch) | |
tree | fa3dd99ab94de457555101b108673943c65b8c6d /js/controllers | |
parent | 3673372c1bf05840cb009aaaa12af31ce665f6ef (diff) | |
download | ninja-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/controllers')
-rwxr-xr-x | js/controllers/document-controller.js | 7 |
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 | }, |