Note that there are some explanatory texts on larger screens.

plurals
  1. POI can't access to an variables my extension Firefox from iframe
    primarykey
    data
    text
    <p>With the release of the new version of Firefox 16, my extension was to produce an error: "Permission denied to access property 'myVarExt'".</p> <p><em><strong>browser.xul</em></strong></p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;!DOCTYPE overlay SYSTEM "chrome://mynewext/locale/overlay.dtd"&gt; &lt;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"&gt; &lt;script type="application/x-javascript;version=1.7" src="base.js"/&gt; &lt;hbox id="browser"&gt; &lt;splitter insertafter="sidebar-splitter" state="open" resizebefore="closest" resizeafter="closest" id="mynewext-splitter" hidden="true"/&gt; &lt;vbox id="mynewext-sidebar" insertafter="sidebar-splitter" width="308" minwidth="308" maxwidth="308" collapsed="true"&gt; &lt;tabbox flex="1"&gt; &lt;tabpanels id="mynewext-panels" flex="1"&gt; &lt;iframe id="mynewext-dashboard" flex="1"/&gt; &lt;/tabpanels&gt; &lt;/tabbox&gt; &lt;/vbox&gt; &lt;/hbox&gt; &lt;/overlay&gt; </code></pre> <p>The file <em>base.js</em> registered variables and function of the filling iframe:</p> <p><em><strong>base.js</em></strong></p> <pre><code>... var myVarExt='Good!'; //Is the same variable that was accessed ... var xulContentPanel=_('dashboard'); xulContentPanel.contentDocument.location.href = 'resource://mynewext/html/bodyfirefox.xhtml'; ... </code></pre> <p>Access the variable <em>myVarExt</em> of iframe this way:</p> <p><em><strong>bodyfirefox.xhtml</em></strong></p> <pre><code>&lt;!DOCTYPE HTML&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;head&gt; &lt;title&gt;myBar&lt;/title&gt; &lt;/head&gt; &lt;body&gt;&lt;div id="testExtVar"&gt;&lt;/div&gt;&lt;/body&gt; &lt;script type="text/javascript" &gt; var extVar=parent.myVarExt; document.getElementById('testExtVar').innerHTML = extVar; &lt;/script&gt; &lt;/html&gt; </code></pre> <p>In older versions of Firefox this appeal worked, and the new no. In what could be the problem?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload