Skip to content

Commit 4533b2c

Browse files
authored
fix: Polyfill location.origin for IE10 (getsentry#1325)
1 parent c26696a commit 4533b2c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

vendor/TraceKit/tracekit.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ function getLocationHref() {
3535

3636
function getLocationOrigin() {
3737
if (typeof document === 'undefined' || document.location == null) return '';
38+
39+
// Oh dear IE10...
40+
if (!document.location.origin) {
41+
document.location.origin =
42+
document.location.protocol +
43+
'//' +
44+
document.location.hostname +
45+
(document.location.port ? ':' + document.location.port : '');
46+
}
47+
3848
return document.location.origin;
3949
}
4050

0 commit comments

Comments
 (0)