credentials: 'include'建议使用- 没有解决问题。TypeError: failed to fetchfetch 发送如下:
fetch(url)
.then(response => {
if(!response.ok){
throw Error("Http request failed");
}else{
return response
}
})
.then(response => response.text())
.then(validate => validate.replace(/\D/g,''))
.then(count => {
chrome.action.setBadgeText({text: count});
if(callback){
callback();
}
})
.catch(error => {
console.log(error)
if(callback){
callback();
}
});
Run Code Online (Sandbox Code Playgroud)
如果您能指导我解决可能出现的问题,我将不胜感激。
由于这个问题在几年左右的时间里都没有得到解决,我在 chromium bug tracker 上打开了一个 bug
javascript authentication fetch google-chrome-extension ssl-client-authentication