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:
commit
a00308d5f3
@ -147,20 +147,17 @@ window.onload = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromWeb(url) {
|
async function loadFromWeb(url) {
|
||||||
const lastSlash = url.lastIndexOf("/");
|
const lastSlash = url.lastIndexOf("/");
|
||||||
if (lastSlash) {
|
if (lastSlash) {
|
||||||
gPath = url.substring(0, lastSlash + 1);
|
gPath = url.substring(0, lastSlash + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const r = new XMLHttpRequest();
|
const response = await fetch(url);
|
||||||
r.open("GET", url);
|
if (!response.ok) {
|
||||||
r.onreadystatechange = function () {
|
throw new Error(response.statusText);
|
||||||
if (r.readyState === 4) {
|
}
|
||||||
processLog(r.response);
|
processLog(await response.text());
|
||||||
}
|
|
||||||
};
|
|
||||||
r.send(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fileEntryChanged() {
|
function fileEntryChanged() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user