在Firefox中通过HtmlService使用Polymer时出现的问题
我刚刚注意到,以前在Firefox中运行的代码现在抛出了错误 这是一个简单的Google Apps脚本示例代码(嵌入在Google电子表格中),用于重现该问题: 服务器端:在Firefox中通过HtmlService使用Polymer时出现的问题,firefox,google-apps-script,polymer,Firefox,Google Apps Script,Polymer,我刚刚注意到,以前在Firefox中运行的代码现在抛出了错误 这是一个简单的Google Apps脚本示例代码(嵌入在Google电子表格中),用于重现该问题: 服务器端: function uiTest(){ var html = HtmlService.createTemplateFromFile('ui-test'); var ui = html.evaluate().setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWA
function uiTest(){
var html = HtmlService.createTemplateFromFile('ui-test');
var ui = html.evaluate().setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
SpreadsheetApp.getUi().showModelessDialog(ui," ");
}
其中,ui测试html:
<head>
<base href="//polygit.org/components/">
<link rel="import" href="polymer/polymer.html">
<script src="webcomponentsjs/webcomponents.js" type="text/javascript"></script>
<link rel="import" href="paper-material/paper-material.html">
<dom-module id="ui-firefox">
<template>
<paper-material>Can you see me in Firefox?</paper-material>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: "ui-firefox",
ready: function() {
console.log("Am I ready?");
}
});
});
</script>
</dom-module>
</head>
<body>
<ui-firefox> </ui-firefox>
</body>
你能在Firefox中看到我吗?
HTMLImports.whenReady(函数(){
聚合物({
是:“ui firefox”,
就绪:函数(){
日志(“我准备好了吗?”);
}
});
});
错误如下
由于MIME类型不匹配,来自“”的资源被阻止(X-Content-type-Options:nosniff)
关于如何解决/避免这个问题有什么想法吗?
随着2018年1月23日Firefox 58版的发布,这个问题已经过去,不再发生。
希望它能保持这种状态…在电子表格中使用时设置origin:allowall有什么原因吗?@SpenceEaston没有原因,我只是尝试了一下,然后放在那里,如果删除了就没有变化了——谢谢