I have an issue in a non production environment in Internet Explorer 11 where
window.location.origin
is undefined
.
However, in the production environment this value actually returns
window.location.origin = http://www.myproductionwebsite.com
This issue only exists in Internet Explorer and works fine in Chrome and Firefox across production and non production environments, which has lead me to believe its the way that the Chakra JavaScript Engine in IE11 populates origin
.
I have also looked at the request and response headers across production and non production environment and all the parameters are identical.
How does Internet Explorer 11 calculate window.location.origin
differently to Chrome or Firefox?
Intranet sites are set to Compatibility View, which disables window.location.origin
:
Pages will run in Compatibility View unless they explicitly specify another document mode. This option can be disabled using the Tools > Compatibility View Settings menu.
Sites are placed in the Intranet Zone based on the following criteria:
Direct Mapping. As with other Zones, users or network admins may map a list of URL patterns into the Local Intranet Zone. This list is viewable by clicking Tools > Internet Options > Security > Local Intranet > Sites > Advanced.
The PlainHostName rule (aka “The Dot rule”). If the URI’s hostname doesn’t contain any periods (e.g. http://team/) then it is mapped to the Local Intranet Zone.
The fixed Proxy Bypass list. If the user has a fixed proxy specified inside Tools > Internet Options > Connections > LAN Settings, then sites listed to bypass that proxy will be mapped to the Local Intranet zone. The fixed proxy bypass list can be found by clicking the Advanced button; it’s at the bottom of the screen in the box labeled Exceptions.
(WPAD) Proxy Script. If the user’s proxy configuration is “Automatically detect settings” or “Use automatic configuration script” inside Tools > Internet Options > Connections > LAN Settings, the browser will run the FindProxyForUrl function in the specified WPAD proxy configuration script to determine which proxy should be used for each request. If the script returns “DIRECT”, the browser will bypass the proxy and the site will be mapped into the Local Intranet Zone. When mapping a URL to a Zone, URLMon will call the FindProxyForUrl function to determine if the bypass rule applies. One interesting twist is that the proxy script may itself call dnsResolve to get a site’s IP address and use that information as a part of its determination.
References