Merge pull request #14638 from Snuffleupagus/reftest-analyzer-fetch

Replace XMLHttpRequest usage with the Fetch API in the reftest-analyzer
This commit is contained in:
Tim van der Meij 2022-03-06 16:37:31 +01:00 committed by GitHub
commit a00308d5f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,20 +147,17 @@ window.onload = function () {
}
}
function loadFromWeb(url) {
async function loadFromWeb(url) {
const lastSlash = url.lastIndexOf("/");
if (lastSlash) {
gPath = url.substring(0, lastSlash + 1);
}
const r = new XMLHttpRequest();
r.open("GET", url);
r.onreadystatechange = function () {
if (r.readyState === 4) {
processLog(r.response);
}
};
r.send(null);
const response = await fetch(url);
if (!response.ok) {
throw new Error(response.statusText);
}
processLog(await response.text());
}
function fileEntryChanged() {