내 firefox 확장에 myExt 개체가 있습니다.현재 문서/창에서 firefox 확장 변수에 액세스하는 방법
myExt = {
request: function(){
//adds dynamic script element to the current webpage's head tag
},
callback: function(json) {
//do something with this
}
};
myExt.request는 JSON을 반환하는 서버에 동적으로 추가 된 스크립트 요소를 추가, 내가 json으로 나의 확장의 JS 코드 내에 존재 myExt.callback로 전송하고 싶습니다. 내 확장에서
//from my extension, i add a script element
myExt.request();
핑 다시 웹 페이지
//from server i get the following response
myExt.callback ({"some":"json"}) ;
//but the window doesnt find a reference to myExt
에 내가 웹 페이지에서 myExt 변수에 대한 참조를 어떻게해야합니까 서버를?