使用聚合物時,我只注意到在Firefox中工作過的一個代碼,引發錯誤現在問題通過HtmlService在Firefox
這是一個簡單的谷歌Apps腳本示例代碼(內嵌在谷歌電子表格)來重現問題:
服務器側:
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>
錯誤如下...
來自「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:允許當在電子表格內使用? –
@SpencerEaston沒有理由,我只是想它,讓它在那裏,如果刪除沒有改變 - 謝謝 –