Re: [PageVisibility] location of the interface

On Mon, May 2, 2011 at 4:08 PM, Cameron McCormack <> wrote:
> Jonas Sicking:
>> I partially agree with you. However it's always iffy to place things
>> on the window object as that is the global namespace for scripts, and
>> so you have to worry about colliding with global variables.
> Itís fine in Firefox, where declaring and assigning to variables doesnít
> interfere with properties from the Window object, but I see that could
> be troublesome for other browsers. †(If we could eventually get to the
> point where it is safe to extend Window across implementations thatíd be
> good.)

It's only true in Firefox if people write code like:

var foo = "bar";

however not good if they write:

if (foo) {

But I think the Window is the best place to put it as long as we use a
name that is descriptive enough that it's unlikely to collide with
existing pages. I'm not a fan of names like 'performance' which was
recently added by another spec.

/ Jonas

Received on Monday, 2 May 2011 23:31:34 UTC