2016-04-17 12 views
1

私はhttps://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/panelの提案で、私のパネルの内容を更新するためにcontentScriptを使用しています。現在、私は自分のパネルに表示したいhtmlを返すサーバーを持っています。私は、応答の準備ができていて、しかし、私は何も更新されて表示されていないFirefoxの拡張機能でパネルの内容を更新する

self.port.on("update_panel", handleMessage); 

function handleMessage(message) { 
    document.write(message); 
} 

が含まれているパネルに関連付けられたcontentScriptFileを持っているとき、私はpanel.postMessage("update_panel", contents);を行う、と私はまたcontentScriptFileをデバッグすることができないんだ(ありますそうする方法はありますか?)。

私は間違っていますか?

答えて

0

私は何かを考え出した。

panel.port.on("updating_done", function(response) { 
    console.log(response); 
}); 

panel.port.emit("update_panel", contents); 

誰でもこの動作がなぜ起こるのか説明でき、postMessageがそうでない場合、それは素晴らしいことです。