When I use location.href='https://google.com', the fetch request has already been sent, but is aborted by webview or browser as js does the location.href jump.
How can we get the abort flag? in the fetch standard doc concept-response-aborted
A response can have an associated aborted flag, which is initially unset.
This indicates that the request was intentionally aborted by the developer or end-user.
what is the aborted flag? How can developer get this flag? or chrome fetch listed, use error.name === 'AbortError'?
fetch(url, { signal }).then(response => {
return response.text();
}).then(text => {
console.log(text);
}).catch(err => {
if (err.name === 'AbortError') {
console.log('Fetch aborted');
} else {
console.error('Uh oh, an error!', err);
}
});