From 1fe602603bb98ef6137209050008420c50cdf75c Mon Sep 17 00:00:00 2001 From: lutovich Date: Thu, 27 Sep 2018 19:16:11 +0200 Subject: [PATCH] Fix checking of window global variable in strict mode Previous version of the check failed in strict mode with error "window is not defined". Strict mode is default in Webpack. --- src/v1/internal/browser/browser-channel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v1/internal/browser/browser-channel.js b/src/v1/internal/browser/browser-channel.js index 0c0a5c71b..2b44b6eff 100644 --- a/src/v1/internal/browser/browser-channel.js +++ b/src/v1/internal/browser/browser-channel.js @@ -300,5 +300,5 @@ function verifyEncryptionSettings(encryptionOn, encryptionOff, secureProtocol) { } function detectWebPageProtocol() { - return window && window.location ? window.location.protocol : null; + return typeof window != 'undefined' && window.location ? window.location.protocol : null; }