Angular 6 - IOS中的Chrome - 路由器问题

Max*_*ion 5 google-chrome ios google-cast angular angular-router

我正在开发一个Angular 6网站,我只在IOS(iPad,iPhone)的Chrome上面临一个奇怪的问题.

直接转到每个链接时,每个页面都会正确呈现.但是当我点击任何页面中的任何链接时,它会生成类似这样的NavigationError:

TypeError: Argument 1 ('other') to Node.contains must be an instance of Node
TypeError: Argument 1 ('node') to Node.insertBefore must be an instance of Node
Run Code Online (Sandbox Code Playgroud)

在IOS中调试Chrome非常困难,因此很难获得更多信息.

我的网站在任何其他浏览器和操作系统,Firefox(Windows,Linux),Chrome(Windows和Linux),Safari(ios,osx,windows)上运行良好.

任何人都知道从哪里开始寻找?

谢谢!

Max*_*ion 0

显然,当此代码存在时,问题仅发生在 Google Chrome iOS 上:

let script = window['document'].createElement('script');
script.setAttribute('type', 'text/javascript');
script.setAttribute('src', 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1');
window['document'].body.appendChild(script);
window['__onGCastApiAvailable'] = function (isAvailable) { /*Do chromecast initialization*/}
Run Code Online (Sandbox Code Playgroud)

所以我添加了这个条件:

if(!navigator.userAgent.match('CriOS'))
Run Code Online (Sandbox Code Playgroud)

问题解决了。

我真的不知道为什么强制转换框架会破坏角度路由。