Re: Proposal for a page visibility API

2011-01-23 Thread Robert O'Callahan
On Fri, Jan 21, 2011 at 10:24 AM, Drew Wilson wrote: > I wanted to point out that many of these use cases are covered adequately > by document.focus()/document.blur(), which is what we currently use in Gmail > to decide whether to mark the user as away, decide whether to display > notifications,

Re: Proposal for a page visibility API

2011-01-21 Thread Alex Komoroske
On Thu, Jan 20, 2011 at 1:24 PM, Drew Wilson wrote: > > > On Thu, Jan 20, 2011 at 12:13 PM, Alex Komoroske > wrote: > >> For clarity, I've included the current draft of the proposal below, which >> incorporates the feedback from this thread. >> >> >> >> >> There is currently no good way for

Re: Proposal for a page visibility API

2011-01-21 Thread Alex Komoroske
On Thu, Jan 20, 2011 at 12:50 PM, Glenn Maynard wrote: > On Thu, Jan 20, 2011 at 2:36 PM, Alex Komoroske wrote: > >> If you intend "preview" to include large but smaller-than-full-size >>> previews, eg. scaled to 50%, I'd recommend avoiding the word "thumbnail"; I >>> think most people wouldn't c

Re: [Desktop-extensions-team] Proposal for a page visibility API

2011-01-21 Thread Alexey Feldgendler
On Thu, 20 Jan 2011 11:51:17 +0100, Charles McCathieNevile wrote: Use cases * An app can provide notifications (using the Web Notification stuff that is under developemnt) when it is not visible/focused, but skip them when it is to minimise distractions and reduce cognitive load * An ap

Re: Proposal for a page visibility API

2011-01-20 Thread Glenn Maynard
On Thu, Jan 20, 2011 at 6:46 PM, Marcos Caceres wrote: > I wonder if view mode media features [1] + CSSOM View's matchMedia() method > [2] would help meet the requirements? Could looks something like: > > var mql = matchMedia("(view-mode:hidden)") > mql.addListener(handleHide) > > We would, of cou

Re: Proposal for a page visibility API

2011-01-20 Thread Marcos Caceres
On 1/20/11 11:51 AM, Charles McCathieNevile wrote: On Thu, 20 Jan 2011 03:22:29 +0100, Alex Komoroske wrote: Hi all, There is currently no good way for a web page to detect that it is completely invisible to the user... We have implemented something like this for our extensions framework,

Re: Proposal for a page visibility API

2011-01-20 Thread Glenn Maynard
On Thu, Jan 20, 2011 at 4:24 PM, Drew Wilson wrote: > In the latter case, I actually don't think your current definition of > visible ("is the focused tab in some browser window somewhere, even if that > window is completely obscured by other windows") adequately addresses that > use case (either

Re: Proposal for a page visibility API

2011-01-20 Thread Drew Wilson
On Thu, Jan 20, 2011 at 12:13 PM, Alex Komoroske wrote: > For clarity, I've included the current draft of the proposal below, which > incorporates the feedback from this thread. > > > > > There is currently no good way for a web page to detect that it is > completely invisible to the user (fo

Re: Proposal for a page visibility API

2011-01-20 Thread Glenn Maynard
On Thu, Jan 20, 2011 at 2:36 PM, Alex Komoroske wrote: > If you intend "preview" to include large but smaller-than-full-size >> previews, eg. scaled to 50%, I'd recommend avoiding the word "thumbnail"; I >> think most people wouldn't consider that a thumbnail. (I could probably >> come up with a

Re: Proposal for a page visibility API

2011-01-20 Thread Glenn Maynard
On Thu, Jan 20, 2011 at 5:51 AM, Charles McCathieNevile wrote: > * An application can (try to) communicate with the currently focused > application. Is this a use case for visibility, or focus? Focus is also important (not sure if the fairly ubiquitous window focus events remain unspecced), but

Re: Proposal for a page visibility API

2011-01-20 Thread Alex Komoroske
For clarity, I've included the current draft of the proposal below, which incorporates the feedback from this thread. There is currently no good way for a web page to detect that it is completely invisible to the user (for example, that it is a background tab), although some imperfect heuri

Re: Proposal for a page visibility API

2011-01-20 Thread Alex Komoroske
On Thu, Jan 20, 2011 at 6:47 AM, Boris Zbarsky wrote: > On 1/20/11 5:02 AM, Glenn Maynard wrote: > >>* Values returned by all conforming implementations >> * “visible” : the full-size page content may be at least >>partially visible on at least one screen. >> >> More simply, "the

Re: Proposal for a page visibility API

2011-01-20 Thread Alex Komoroske
On Thu, Jan 20, 2011 at 2:51 AM, Charles McCathieNevile wrote: > On Thu, 20 Jan 2011 03:22:29 +0100, Alex Komoroske > wrote: > > Use cases >> > > * An app can provide notifications (using the Web Notification stuff that > is under developemnt) when it is not visible/focused, but skip them when i

Re: Proposal for a page visibility API

2011-01-20 Thread Alex Komoroske
On Thu, Jan 20, 2011 at 2:02 AM, Glenn Maynard wrote: > On Wed, Jan 19, 2011 at 9:22 PM, Alex Komoroske wrote: >> >> Use cases >> >> * A page wants to detect when it is being prerendered so it can behave >> appropriately. >> * A puzzle game has a timer that keeps track of how long the user has >>

Re: Proposal for a page visibility API

2011-01-20 Thread Boris Zbarsky
On 1/20/11 5:02 AM, Glenn Maynard wrote: * Values returned by all conforming implementations * “visible” : the full-size page content may be at least partially visible on at least one screen. More simply, "the full-size page content may be at least partially visible".

Re: Proposal for a page visibility API

2011-01-20 Thread Charles McCathieNevile
On Thu, 20 Jan 2011 03:22:29 +0100, Alex Komoroske wrote: Hi all, There is currently no good way for a web page to detect that it is completely invisible to the user... We have implemented something like this for our extensions framework, where it is common to have messaging between a tb

Re: Proposal for a page visibility API

2011-01-20 Thread Glenn Maynard
On Wed, Jan 19, 2011 at 9:22 PM, Alex Komoroske wrote: > > Use cases > > * A page wants to detect when it is being prerendered so it can behave > appropriately. > * A puzzle game has a timer that keeps track of how long the user has taken > to solve the puzzle. It wants to pause the timer when the

Proposal for a page visibility API

2011-01-20 Thread Alex Komoroske
Hi all, There is currently no good way for a web page to detect that it is completely invisible to the user (for example, that it is a background tab), although some imperfect heuristics do exist. In the future, there may be cases where such detection is even more important, for example in the pre