最新的Canary,Angular / Webcomponents / Polymer / Polyfill已损坏

这是我仅在Canary v80中看到的错误。我有一个Angular 1.3 / Webcomponents 0.7应用程序,并且几个UI元素无法正确呈现。很难找到应用程序的哪个元素引发错误。

例如,我有一个包含文本字段,下拉列表和按钮的页面。在开发工具中,我看到一个错误

exception: TypeError: Cannot read property 'childNodes' of undefined at nodeLinkFn
at compositeLinkFn ..at compositeLinkFn.. at nodeLinkFn.. at compositeLinkFn ...

在另一页中,我有

 el.getPropertyInfo is not a function 
{exception: TypeError: el.getPropertyInfo is not a function..

cause: "<paper-menu class="dropdown-content ng-pristine ng-untouched ng-valid ng-isolate-scope" selected="{{xxx.yyy}}" data-ng-model="xxx" attr-for-selected="name" gi-polymer-event-bind="iron-select:aaa(xxx)" role="menu" tabindex="0">"

所有这些功能都可以在Chrome中完美运行。

X00400 回答:最新的Canary,Angular / Webcomponents / Polymer / Polyfill已损坏

快速解决方法::将origin-trails令牌添加到index.html

请按照以下步骤生成令牌:

您可以通过请求来源标记(https://developers.chrome.com/origintrials/)来选择将来源上的任何页面用于试验性功能。注册试用版后,我们将为您的来源生成令牌。

有两种方法可以在您来源的任何页面上提供此令牌:

  • 将原始审判标签添加到任何页面的开头。例如,看起来可能像这样:

    <meta http-equiv="origin-trial" content="**insert your token as provided in the developer console**">

  • 如果可以配置服务器,则还可以使用Origin-Trial HTTP标头在页面上提供令牌。生成的响应标头应类似于:

    Origin-Trial: **token as provided in the developer console**

注意:您可以为给定页面提供多个令牌。启用试用版仅需一个有效令牌,其他任何无效令牌或不匹配的令牌都将被忽略。如果将同一页面投放到不同的来源(例如example.com,example.ca等),则可能需要提供多个令牌。您可以在页面中添加多个标签,包括多个Origin-Trial响应标头或单个Origin-Trial响应标头,并以逗号分隔。

参考:https://github.com/GoogleChrome/OriginTrials/blob/gh-pages/developer-guide.md

本文链接:https://www.f2er.com/3164948.html

大家都在问