Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

firing pageshow/pagehide when users change tabs

18 views
Skip to first unread message

Myk Melez

unread,
Oct 31, 2006, 4:49:45 AM10/31/06
to
We currently fire pageshow and pagehide events when users go backwards
and forwards in history. It seems like it would make sense to also fire
those events when users change tabs, since changing tabs has the same
effect as changing one's place in history: one page gets hidden while
another gets revealed.

And it seems like pages which want to do something when revealed (like
update their content) would want to do it whether they were revealed by
history traversal or tab activation.

A corollary benefit would be that extensions which want to do something
whenever a page is focused would only have to listen for pageshow. They
wouldn't have to also implement a web progress listener that listens for
onLocationChange.

Thoughts?

-myk

Eric Shepherd

unread,
Oct 31, 2006, 10:34:50 AM10/31/06
to Myk Melez, dev-apps...@lists.mozilla.org
I love this idea.


Eric Shepherd
Developer Documentation Lead
she...@mozilla.com

Tony Chang

unread,
Oct 31, 2006, 3:03:59 PM10/31/06
to
Myk Melez <m...@mozilla.org> wrote:
> A corollary benefit would be that extensions which want to do something
> whenever a page is focused would only have to listen for pageshow. They
> wouldn't have to also implement a web progress listener that listens for
> onLocationChange.

Hmm? I normally listen for the select event on the tabbox in addition to
pageshow. Extensions that already do this would have to do version
checking to make sure things don't fire twice.

Tony

Myk Melez

unread,
Nov 1, 2006, 5:27:29 PM11/1/06
to
Tony Chang wrote:

> Hmm? I normally listen for the select event on the tabbox in addition to
> pageshow. Extensions that already do this would have to do version
> checking to make sure things don't fire twice.

Right, as would extensions like Microsummary Buddy which listen for
onLocationChange to accomplish the same effect. But once updated, such
extensions would sport much simpler code.

-myk

0 new messages