2012-10-13 3 views
0

새로운 버전의 Firefox 16이 출시되면서 내 확장 프로그램에서 "속성 'myVarExt'에 액세스 할 수있는 권한이 거부되었습니다."라는 오류가 발생했습니다.변수에 액세스 할 수 없습니다 내 확장 프로그램 iframe에서 Firefox

browser.xul

<?xml version="1.0"?> 
<!DOCTYPE overlay SYSTEM "chrome://mynewext/locale/overlay.dtd"> 
<overlay id="mynewext-overlay" 
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
     xmlns:svg="http://www.w3.org/2000/svg" 
     xmlns:html="http://www.w3.org/1999/xhtml"> 
<script type="application/x-javascript;version=1.7" src="base.js"/> 
<hbox id="browser"> 
    <splitter insertafter="sidebar-splitter" 
       state="open" 
       resizebefore="closest" 
       resizeafter="closest" 
       id="mynewext-splitter" 
       hidden="true"/> 
    <vbox id="mynewext-sidebar" 
      insertafter="sidebar-splitter" 
      width="308" 
      minwidth="308" 
      maxwidth="308" 
      collapsed="true"> 
     <tabbox flex="1"> 
     <tabpanels id="mynewext-panels" flex="1"> 
      <iframe id="mynewext-dashboard" flex="1"/> 
     </tabpanels>   
     </tabbox> 
    </vbox> 
    </hbox> 
</overlay> 

파일 base.js 등록 변수 및 함수 충전이 iframe :

base.js

... 
var myVarExt='Good!'; //Is the same variable that was accessed 
... 
var xulContentPanel=_('dashboard'); 
xulContentPanel.contentDocument.location.href = 'resource://mynewext/html/bodyfirefox.xhtml'; 
... 

액세스 변수 myVarExt은 iframe의이 방법 :

bodyfirefox.xhtml이 항소했다 파이어 폭스의 이전 버전에서

<!DOCTYPE HTML><html xmlns="http://www.w3.org/1999/xhtml"><head> 
    <title>myBar</title> 
    </head> 
<body><div id="testExtVar"></div></body> 
<script type="text/javascript" > 
var extVar=parent.myVarExt; 
document.getElementById('testExtVar').innerHTML = extVar; 
</script> 
</html> 

, 새로운 없음. 무엇이 문제가 될 수 있습니까?

답변

0

문제가 해결되었습니다. //크롬 :

  1. iframe에서
  2. 자원의 콘텐츠를 전송 TYPE = "콘텐츠"를 사용하지 // (크롬 자원보다 우선 순위를 갖는다).

음 따라 크롬

을위한 자원에 지불 방법을 다시 썼다
관련 문제