之後沒有反應,在iOS webapp中使用argelius' favorite star後,其js變得無響應。在桌面Safari瀏覽器中,它的作品,但給出了錯誤Refused to get unsafe header "Location"
,經過挖掘似乎是無關的,但我想我應該提到它。webapp在argelius的最愛明星
任何想法?
可能是我實現它的方式有問題,這是我實現的第一個GitHub存儲庫。
這個代碼是在<head>
:
<script src="https://argelius.github.io/favorite-star/bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="https://argelius.github.io/favorite-star/favorite-star.html">
編輯:使用的是iOS網頁檢查後,我發現,scope.wrappers.Window
回到null
,進一步挖掘我發現這個解決方案:
變化:
function getDescriptor(source, name) {
try {
return Object.getOwnPropertyDescriptor(source, name);
} catch (ex) {
return dummyDescriptor;
}
}
作爲:
function getDescriptor(source, name) {
try {
var desc = Object.getOwnPropertyDescriptor(source, name);
if (desc) return desc;
} catch (ex) {
// Just return a dummy descriptor
}
return dummyDescriptor;
}
我想弄清楚,但我找到他們假設你知道這是如何工作的頁面...我如何使用nom或bower進行安裝? –
你在當地的環境中是否有npm? –
我不知道,我用eclipse編碼,並通過openshift託管我的網站。 –