角度 6 - IOS 中的铬 - 路由器问题



我正在开发一个 Angular 6 网站,我只在 IOS(iPad、iPhone(的 Chrome 上遇到一个奇怪的问题。

直接转到每个链接时,每个页面都会正确呈现。但是当我单击任何页面中的任何链接时,它会生成如下所示的导航错误:

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

在IOS中调试Chrome真的很难,所以很难获得更多信息。

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

有人知道从哪里开始寻找吗?

谢谢!

显然,当存在此代码时,问题仅在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*/}

所以我添加了这个条件:

if(!navigator.userAgent.match('CriOS'))

问题已解决。

我真的不知道为什么铸造框架会破坏角度路由。

最新更新