From 5c66fe0ef1fb35817c787e1a871c532a488216ce Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 15 Dec 2014 12:11:03 -0800 Subject: [PATCH] Blocking issues workaround Added force no-ssl version Added no-redirect version --- app/js/controllers.js | 3 +++ app/js/lib/config.js | 3 ++- app/js/services.js | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 620cc5e1..09d96ae1 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -18,6 +18,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) return; } if (location.protocol == 'http:' && + !Config.Modes.http && Config.App.domains.indexOf(location.hostname) != -1) { location.protocol = 'https:'; return; @@ -40,6 +41,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) return; } if (location.protocol == 'http:' && + !Config.Modes.http && Config.App.domains.indexOf(location.hostname) != -1) { location.protocol = 'https:'; } @@ -633,6 +635,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) if (error.code == 401) { MtpApiManager.logOut()['finally'](function () { if (location.protocol == 'http:' && + !Config.Modes.http && Config.App.domains.indexOf(location.hostname) != -1) { location.protocol = 'https:'; } else { diff --git a/app/js/lib/config.js b/app/js/lib/config.js index 885efca2..1ee0df46 100644 --- a/app/js/lib/config.js +++ b/app/js/lib/config.js @@ -28,7 +28,8 @@ Config.App = { Config.Modes = { test: location.search.indexOf('test=1') > 0, debug: location.search.indexOf('debug=1') > 0, - ssl: location.search.indexOf('ssl=1') > 0 || location.protocol == 'https:', + http: location.search.indexOf('http=1') > 0, + ssl: location.search.indexOf('ssl=1') > 0 || location.protocol == 'https:' && location.search.indexOf('ssl=0') == -1, nacl: location.search.indexOf('nacl=0')== -1, webcrypto: location.search.indexOf('webcrypto=0')== -1, packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:', diff --git a/app/js/services.js b/app/js/services.js index 93fea430..43e4e7a3 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -4026,6 +4026,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) function start () { if (started || location.protocol != 'http:' || + Config.Modes.http || Config.App.domains.indexOf(location.hostname) == -1) { return; }