Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 阻止Chrome中的身份验证对话框_Javascript_Google Chrome_Authentication_Basic Authentication - Fatal编程技术网

Javascript 阻止Chrome中的身份验证对话框

Javascript 阻止Chrome中的身份验证对话框,javascript,google-chrome,authentication,basic-authentication,Javascript,Google Chrome,Authentication,Basic Authentication,我有一个使用基本身份验证的RESTAPI。有一个web客户端,它使用XmlHttpRequest手动发送Authorization头,以防止基本身份验证的常见问题,如不注销。只要web客户端和RESTAPI位于两个不同的来源上,一切都可以正常工作 但是,如果它们部署在同一个源上,Chrome会显示基本身份验证对话框。有没有什么方法可以防止它们在同一来源上出现这种情况

我有一个使用基本身份验证的RESTAPI。有一个web客户端,它使用
XmlHttpRequest
手动发送
Authorization
头,以防止基本身份验证的常见问题,如不注销。只要web客户端和RESTAPI位于两个不同的来源上,一切都可以正常工作

但是,如果它们部署在同一个源上,Chrome会显示基本身份验证对话框。有没有什么方法可以防止它们在同一来源上出现这种情况