Note that there are some explanatory texts on larger screens.

plurals
  1. POChanges to Firefox browser.xul not updating in real time
    primarykey
    data
    text
    <p>I'm running into some sort of event loop issue when making real time changes to browser.xul from a Firefox extension. Changes I am making to the browser.xul are not reflected in the browser window until my code finishes. This happens even when I use setTimeout.</p> <p>I have an example that demonstrates the issue below. When I click on the "xultest runtest" button nothing happens for a few seconds and then the xultest-text is shown as XXXXXXXXXX. I never see the XX,XXX,XXXX... in between.</p> <p>Can someone explain what is going on with the browser.xul event loop and how to work around it (thanks!)?</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml-stylesheet href="css/overlay.css" type="text/css"?&gt; &lt;overlay id="xultest-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt; &lt;script type="text/javascript"&gt; &lt;![CDATA[ function xultestRunTest2() { for (var i = 0; i &lt; 10; i++) { setTimeout(function() { document.getElementById("xultest-text").value = document.getElementById("xultest-text").value + "X" }, 5000); } } ]]&gt; &lt;/script&gt; &lt;toolbox id="navigator-toolbox"&gt; &lt;toolbar id="xultest-toolbar" toolbarname="xultesttoolbar" class="chromeclass-toolbar" context="toolbar-context-menu" hidden="false" persist="hidden"&gt; &lt;toolbarbutton oncommand="xultestRunTest2();" label="xultest runtest" /&gt; &lt;label id="xultest-text" class="toolbarbutton-text" value="X"&gt;&lt;/label&gt; &lt;/toolbar&gt; &lt;/toolbox&gt; &lt;/overlay&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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