summaryrefslogtreecommitdiffstats
path: root/toolkit/components/url-classifier/tests/mochitest/trackingRequest.js
blob: 2720578eeda826877030cab5fe923769b57cce56 (plain)
1
2
3
4
5
6
7
8
9
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);
  }
});