electron/spec-main/fixtures/pages/fetch.html

15 lines
355 B
HTML

<html>
<body>
<script>
window.ajax = async (url, options) => {
const response = await fetch(url, options);
const data = await response.text();
const headers = {};
for (const [key, value] of response.headers.entries()) {
headers[key] = value;
}
return {data, status: response.status, headers};
}
</script>
</body>
</html>