Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
bugfix for window.location.origin in old IE versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ecaroth committed Feb 17, 2017
1 parent 3ab77df commit d76690b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
9 changes: 8 additions & 1 deletion dev/xdomain_cookie.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,16 @@
var ifr = document.createElement('iframe');
ifr.style.display = 'none';
ifr.id = 'xdomain_cookie_'+_id;

var origin = window.location.origin;
//IE fix
if(!origin){
origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
}

var data = {
namespace: _namespace,
window_origin: window.location.origin,
window_origin: origin,
iframe_origin: iframe_path,
debug: _debug
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xdomain-cookies",
"version": "1.0.7",
"version": "1.0.8",
"repository": {
"type": "git",
"url": "git+https://github.com/contently/xdomain-cookies"
Expand Down
11 changes: 9 additions & 2 deletions src/xdomain_cookie.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Version 1.0.7 xdomain-cookies (http://contently.github.io/xdomain-cookies/) from Contently (https://github.com/contently) */
/* Version 1.0.8 xdomain-cookies (http://contently.github.io/xdomain-cookies/) from Contently (https://github.com/contently) */

(function(exports) {
"use strict";
Expand Down Expand Up @@ -186,9 +186,16 @@
var ifr = document.createElement('iframe');
ifr.style.display = 'none';
ifr.id = 'xdomain_cookie_'+_id;

var origin = window.location.origin;
//IE fix
if(!origin){
origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
}

var data = {
namespace: _namespace,
window_origin: window.location.origin,
window_origin: origin,
iframe_origin: iframe_path,
debug: _debug
};
Expand Down
4 changes: 2 additions & 2 deletions src/xdomain_cookie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d76690b

Please sign in to comment.