From bcd4e5135aa800eb6e8e2bf594c7d9a538f7c7c7 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 21 Apr 2017 01:29:22 -0400 Subject: [PATCH] Use window.top.location instead of window.location (closes #3950) --- modules/util/detect.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/util/detect.js b/modules/util/detect.js index 1a3928c33..c8b24b35f 100644 --- a/modules/util/detect.js +++ b/modules/util/detect.js @@ -99,7 +99,14 @@ export function utilDetect(force) { } setTextDirection(detected.textDirection); - detected.host = window.location && (window.location.origin + window.location.pathname); + // detect host + var loc = window.top.location; + var origin = loc.origin; + if (!origin) { // for unpatched IE11 + origin = loc.protocol + '//' + loc.hostname + (loc.port ? ':' + loc.port: ''); + } + + detected.host = origin + loc.pathname; detected.filedrop = (window.FileReader && 'ondrop' in window);