【发布时间】:2017-08-23 01:05:05
【问题描述】:
我刚刚注意到以前在 Firefox 中运行的代码现在抛出错误
这是重现问题的简单 Google Apps 脚本示例代码(嵌入在 Google 电子表格中):
服务器端:
function uiTest(){
var html = HtmlService.createTemplateFromFile('ui-test');
var ui = html.evaluate().setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
SpreadsheetApp.getUi().showModelessDialog(ui," ");
}
在哪里 ui-test 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>
报错如下...
来自“https://accounts.google.com/ServiceLogin?service=wise&passive=1209600&continue=https://n-47juae2agfc3xqpt4fvdar7apw5jvvjx5nohrjy-0lu-script.googleusercontent.com/webcomponentsjs/webcomponents.js&followup=https://n-47juae2agfc3xqpt4fvdar7apw5jvvjx5nohrjy-0lu-script.googleusercontent.com/webcomponentsjs/webcomponents.js”的资源由于 MIME 类型不匹配(X-Content-Type-Options: nosniff)而被阻止。
关于如何解决/避免此问题的任何想法?
【问题讨论】:
-
在电子表格中使用时是否有 set-origin:allowall 的原因?
-
@SpencerEaston 没有理由,我只是在尝试并让它放在那里,如果删除也不会改变 - 谢谢
标签: firefox google-apps-script polymer