Files
tubestation/toolkit/components/url-classifier/tests/mochitest/trackingRequest.js
Kershaw Chang 4f65916b2b Bug 1312515 - Part 3: Test case. r=baku
This test aims to test the priority of the http channels created from XHR and Fetch inside a tracking script is lowest.
2017-05-22 03:40:00 -04:00

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);
}
});