Closed Bug 676027 Opened 13 years ago Closed 13 years ago

Real `window` object for `window` objects generated by `windows` module

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: christoph, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build ID: 20110413222027

Steps to reproduce:

I need access to the real `window` object via the `window` objects generated by the `windows` module.

This is needed for https://github.com/cadorn/jetpack-firebug as well as other use-cases.


Actual results:

I don't have access to the real `window` object.


Expected results:

I wish to gain access via `window.unsafeWindow` like we did for another module.

See: https://github.com/cadorn/addon-sdk/blob/f011d4ef2b7e7e9cfc0fd1347cd819db7e8de169/packages/addon-kit/lib/windows.js#L141-143
The Windows API in addon-kit is designed to be a "high-level" API that provides a layer of abstraction on top of the DOM interface presented by DOMWindow objects.  It's also designed to work with addons loaded in separate processes, which don't have access to DOMWindow references (or any object references from other processes, for that matter).  So we can't provide access to DOMWindow objects from that API.

However, it *is* possible to obtain DOMWindow objects from the low-level window-utils module in the api-utils package.  There are a couple caveats--the module is "internal" and subject to change, and it will undoubtedly change significantly when we start loading addons in separate processes--but it does give you access to DOMWindow objects for the host application's windows.

See the docs on window-utils <https://addons.mozilla.org/en-US/developers/docs/sdk/1.0/packages/api-utils/docs/window-utils.html>, but also look at the source <https://github.com/mozilla/addon-sdk/blob/master/packages/api-utils/lib/window-utils.js>, which exports some functionality that doesn't seem to be mentioned in the docs (like browserWindowIterator).
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.