Update host.js
window can be defined and yet window.location can be undefined: both "window" and "window.location" must be defined to access to "protocol" information
This commit is contained in:
@ -12,7 +12,7 @@ var startsWithProtocolRE = /^([a-z]+:)?\/\//;
|
||||
var defaultProto = 'http:';
|
||||
var btoa;
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
if (typeof window !== 'undefined' && typeof window.location !== 'undefined') {
|
||||
defaultProto = window.location.protocol;
|
||||
btoa = window.btoa;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user