Merge pull request #1081 from baldurmen/local_files_tls

Don't show a TLS warning when loading locally
This commit is contained in:
Lorenz Hübschle-Schneider 2019-12-09 10:25:03 +01:00 committed by GitHub
commit 48fb834e56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,8 +104,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
})();
// Show a TLS warning if GB was loaded over an unencrypted connection,
// except for local instances (testing, cordova, or electron)
$scope.show_tls_warning = (window.location.protocol !== "https:") &&
// except for local instances (local files, testing, cordova, or electron)
$scope.show_tls_warning = (["https:", "file:"].indexOf(window.location.protocol) === -1) &&
(["localhost", "127.0.0.1", "::1"].indexOf(window.location.hostname) === -1) &&
!window.is_electron && !utils.isCordova();