var s = obj.url + '\n' + obj.get_content().location.href + '\n';
const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
const nsIChannel = Components.interfaces.nsIChannel;
+ ////// handle the throbber
+ var throbber = document.getElementById('throbber');
+ if (throbber) {
+ var busy = false;
+ if (!(stateFlags & nsIWebProgressListener.STATE_RESTORING)) {
+ busy = true;
+ throbber.setAttribute('mode','undetermined');
+ }
+ if (stateFlags & nsIWebProgressListener.STATE_STOP) {
+ busy = false;
+ setTimeout(
+ function() {
+ if (!busy) { throbber.setAttribute('mode','determined'); }
+ }, 2000
+ );
+ }
+ }
+ //////
if (stateFlags == 65540 || stateFlags == 65537 || stateFlags == 65552) { return; }
s += ('onStateChange: stateFlags = ' + stateFlags + ' status = ' + status + '\n');
if (stateFlags & nsIWebProgressListener.STATE_IS_REQUEST) {
s += ('\tSTATE_STOP\n');
}
//obj.error.sdump('D_BROWSER',s);
+ if (throbber) { throbber.setAttribute('tooltiptext',s); }
} catch(E) {
obj.error.sdump('D_ERROR','util.browser.progresslistener.onstatechange: ' + (E));
}
<button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
<button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
<spacer flex="1"/>
+ <progressmeter id="throbber" mode="determined" flex="1"/>
<label id="debug" value="Debug" disabled="true" command="cmd_debug" onclick="this.doCommand();" />
<button id="browser_print" label="Print Page" command="cmd_print" hidden="true"/>
</hbox>
<button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
<button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
<spacer flex="1"/>
+ <progressmeter id="throbber" mode="determined" flex="1"/>
<label id="debug" value="Debug" disabled="true" command="cmd_debug" onclick="this.doCommand();" />
<button id="browser_print" label="Print Page" oldcommand="cmd_print" hidden="true"
oncommand="netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); if (g.browser.alt_print) { JSAN.use('util.print'); var p = new util.print(); p.NSPrint(g.browser.get_content(),false,{}); } else { g.browser.get_content().print(); }"