Skip to content

Commit

Permalink
Merge pull request #46 from adobe/ie_working_sandbox
Browse files Browse the repository at this point in the history
Get the sandbox working in IE
  • Loading branch information
jonsnyder committed Jun 3, 2019
2 parents 65cbf5f + 62df5e7 commit 01e5e19
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion sandbox/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
<meta http-equiv="Content-Security-Policy"
content="default-src 'self';
script-src 'self' 'unsafe-inline';
Expand Down Expand Up @@ -39,7 +40,7 @@
"xdm:URL": [location.href],
"xdm:name": [location.pathname.substring(1) || "home"]
}
}).then(() => {
}).then(function() {
console.log("View start event has triggered.");
});

Expand Down
6 changes: 4 additions & 2 deletions src/components/Personalization/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ const showElement = selector => {
const key = buildKey(KEY_PREFIX, selector);
const elements = document.querySelectorAll(`.${key}`);

elements.forEach(e => removeFrom(document.head, e));
// elements is a nodeList, and in IE nodeList does not support forEach
for (let i = 0; i < elements.length; i += 1) {
removeFrom(document.head, elements[i]);
}
};

const render = (cache, event, logger) => {
Expand Down Expand Up @@ -150,7 +153,6 @@ const createPersonalization = ({ logger }) => {
response.getPayloadByType("personalization:run") || [];

// Caution!!! Here comes Target black magic

personalization.forEach(option => {
const { selector, eventToken } = option;
const key = buildKey(KEY_DETECT_PREFIX, selector);
Expand Down
4 changes: 3 additions & 1 deletion src/core/network/xhrRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export default XMLHttpRequest => {
}
}
};
request.responseType = "text";
request.onloadstart = () => {
request.responseType = "text";
};
request.open("POST", url, true);
request.setRequestHeader("Content-Type", "application/json");
request.withCredentials = false;
Expand Down

0 comments on commit 01e5e19

Please sign in to comment.