This test aims to test the priority of the http channels created from XHR and Fetch inside a tracking script is lowest.
12 lines
285 B
JavaScript
12 lines
285 B
JavaScript
|
|
window.addEventListener("message", function onMessage(evt) {
|
|
if (evt.data.type === "doXHR") {
|
|
var request = new XMLHttpRequest();
|
|
request.open("GET", evt.data.url, true);
|
|
request.send(null);
|
|
}
|
|
else if (evt.data.type === "doFetch") {
|
|
fetch(evt.data.url);
|
|
}
|
|
});
|