YouTube ブランド チャンネルでカスタム ガジェットを作成しました。これは、YouTube の要件として、SSL 準拠のサーバーでホストされています。
ただし、http 経由でチャネルにアクセスすると、postMessage() は https サーバーで呼び出されるため、機能しません。
私のコードは次のようなものです:
var new_height = JSON.stringify({"height": height + "px"});
top.postMessage(new_height, location.protocol +"//www.youtube.com/");
エラーはこんな感じ
Unable to post message to https://www.youtube.com. Recipient has origin http://www.youtube.com.
これを修正するにはどうすればよいですか? ありがとう