Test case is
https://fbug.googlecode.com/svn/tests/issues/ConsoleNotDefined.html
or
<html>
<body onload="javascript:onLoad();">
<script>
function onTimeout() {
location.reload(true);
}
function onLoad() {
if (console && typeof console.log == "function")
console.log("Hello world");
// switch to a different tab then allow the timer to expire.
// it will die with javascript error here.
// Next statement will never execute and
// the page will stop reloading! -- BUG
setTimeout(onTimeout, 3000);
}
</script>
</html>
jjb
cheers,
mike
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
If it is by design, then the bug is
Bug 342715 - Need an API to allow extensions to hook "document load
started" events
Firebug's current scheme for discovering nsIDOMWindows is very lame,
relying on lots of tracing of events and guess work. We know that our
event handlers break somethings and fail to get some cases.
We need to know when an nsIDOMWindow that can have JS/HTML/CSS is
created and when it is destroyed. We need the creation event so we can
create our per window 'context' object to hold data about the page and
so we can add hooks to fill the page's context. We need the destroy
event so we can save a bit of data about the state of firebug for that
page in case of reload or revisit and then clean up.
This bug is one of three that we want to push for Firefox 3.7 (Firebug
1.6 or 1.7). In addition to solving Firebug bugs, it would also make
Chromebug much simpler.
If on the other hand, onLocationChange is supposed to be sent, then I
will file a new bug.
jjb
Core code certainly delivers onLocationChange on reload; if it somehow
doesn't that's a bug.
I can't speak for the tabbrowser.
Since John told me to hijack this thread, I will. Why exactly does
Firebug need an unload listener? Could it make do with a pagehide
listener plus notifications when things are evicted from bfcache? Does
it even handle bfcache navigation correctly right now, or is it simply
not an issue because it effectively disables bfcache at the moment?
-Boris
I suppose I should file a bug then, but it would be so much better for
us to invest in Bug 342715.
>
> Since John told me to hijack this thread, I will.
(BTW I think the newsgroup server is napping today).
> Why exactly does
> Firebug need an unload listener?
So Firebug knows when the page is no longer needed. It unhooks
listeners, saves some state on the side, and deletes it's primary
state for the page.
>Could it make do with a pagehide
> listener plus notifications when things are evicted from bfcache?
We use pagehide but if the page sets a unload handler then pagehide
never fires.
See also Bug 484710 - add pageIgnore event for pages that are ejected
from the bfcache
>Does
> it even handle bfcache navigation correctly right now, or is it simply
> not an issue because it effectively disables bfcache at the moment?
We don't have any bugs related to this as far as I know. We have more
problems before the page gets to the bfcache, because we have to do
funky things to know when a page is created.
jjb
> In investigating a Firebug user's test case it looks like Firefox does
> not deliver "onLocationChange" events to a tab if it is not selected.
This is true if you attach your progress listener to the tabbrowser
itself, as the onLocationChange notification is the one that is used to
update the url bar and it would not make sense to send it for background
tabs.
On the other hand you can listen to the various tab creation and
destruction events and attach progress listeners to each tab's
individual browser.
--
Warning: May contain traces of nuts.
Or use addTabsProgressListener.