On Fri, Jul 17, 2009 at 5:45 PM, Daniel Wagner-Hall<[email protected]> wrote: > Can anyone help me with this? How can I get the window handle of an > element from its JS DOM node? > > Perhaps a little background might help! I'm currently working on > WebDriver, a browser testing automation tool[1], to add Chrome > support. As suggested by the chrome team, this is being written as an > extension with an embedded NPAPI plugin. The original driver worked > with the AutomationProxy, but this is not available in release > binaries, which means that a user would need to compile a custom > version of Chrome; obviously a less than ideal user experience :) > > We use a native interactions library for sending keys/clicks/etc at > the OS level, which requires a window handle to the window containing > the element to do its thing. This library is shared between all the > drivers for a particular platform (at the moment, only Windows, but X > support is coming soon).
John would have a more definite answer, but my understanding is: - all content aside from windowed plugins use one OS-level window, wrapping the "page" - NPAPI has no API for querying for that window Windowed plugins do get a "parent" window from the SetWindow call of NPAPI. You could imagine walking the window hierarchy upwards to figure that out, but it's surely fragile. On different browsers I expect that to be a window arbitrarily below the outer window described above. Even within Chrome it's different: On Windows the nesting is one extra window in the plugin process, then one more in the browser process, and there's an extra "dummy" window used in some circumstances I don't quite understand. On Linux there's just one extra wrapping window browser-side. --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
