Javascript 当http基本用户名/密码位于URL(angularjs)中时,不允许History.pushstate

Javascript 当http基本用户名/密码位于URL(angularjs)中时,不允许History.pushstate,javascript,angularjs,html5-history,Javascript,Angularjs,Html5 History,我有一个angularjs应用程序 我将属性值绑定到URL查询参数以实现书签功能: $location.search(urlParameterName, newVal); 这在chrome、FirefoxOpera和类似 https://www.example.com/somePath/?q=queryParamValue 但是当我使用一个URL时,它也包含了http基本身份验证的用户名/密码 https://someuser:somepassword@www.example.com/som

我有一个angularjs应用程序

我将属性值绑定到URL查询参数以实现书签功能:

$location.search(urlParameterName, newVal);
这在chrome、FirefoxOpera和类似

https://www.example.com/somePath/?q=queryParamValue
但是当我使用一个URL时,它也包含了http基本身份验证的用户名/密码

https://someuser:somepassword@www.example.com/somePath/?q=queryParamValue
  • 铬:好的
  • 火狐:好的
  • 歌剧:失败
opera浏览器控制台中的错误消息:

Failed to execute 'pushState' on 'History': A history state object with URL 'https://www.example.com/somePath/?q=queryParamValue' cannot be created in a document with origin 'https://www.example.com' and URL 'https://someuser:somepassword@www.example.com/somePath/
如何在URL中更改查询参数+在URL中设置用户/传递