拡張機能を構築しています。拡張機能の一部の 1 つは、Javascript を使用して VOIP サーバーからの出力を表示することです。
私はこれを使用しています: https://github.com/CommandChannel/Mumble-Channel-Viewer/wiki
JS が popup.js ファイル内にあり、var が宣言されるようにコンテンツを調整しました (したがって、インライン JS はありません)。
サーバーの JSON 出力は次のとおりです: http://api.lethal-zone.eu/mumble/?view=json&serverId=1これは次のように変更されます: http://api.lethal-zone.eu/mumble/?view =json&serverId=1?callback= ? 指示が言うように。
ただし、次のエラーが表示されます。
Refused to load the script 'http://api.lethal-zone.eu/mumble/?view=json&serverId=1?callback=jQuery1910587204567855224_1369671235456&_=1369671235457' because it violates the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".
ドメインが https:// (?) でない場合、JSONP コールバックは許可されていないようです。
私のマニフェストには次の権限があります。
"permissions": [
"http://*.lethal-zone.eu/*",
"https://*.lethal-zone.eu/*",
"http://api.lethal-zone.eu/mumble/",
"notifications",
"storage"
],
httpsなしでこれを行う方法を知っている人はいますか? または、どこを見ればいいですか?
編集: 表示するコードはあまりありません。div: があり、 https://github.com/CommandChannel/Mumble-Channel-Viewer/blob/master/JavaScript/mumbleViewer.js<div id="mumbleTree"></div>
からの JavaScriptが読み込まれ、で説明されているように使用されますこれらの手順: https://github.com/CommandChannel/Mumble-Channel-Viewer/wiki/Installation-instructionsvar mumbleChannelViewerJsonUri = "http://api.lethal-zone.eu/mumble/?view=json&serverId=1?callback=?";
乾杯