Looks like there is actually a better way:

https://github.com/Gozala/addon-sdk/blob/master/lib/sdk/tabs/utils.js#L189-L194

Although I think in this case it'll be either [frameElement](https://developer.mozilla.org/en-US/docs/DOM/window.frameElement)
or [nsIDocShell.chromeEventHandler](https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIDocShell)

I'd suggest putting something like this into `frame/utils`. 
```js
function getDocumentFrame(document) {
  return document.defaultView.frameElement ||
             document.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
                                                .getInterface(Ci.nsIWebNavigation)
                                                .QueryInterface(Ci.nsIDocShell)
                                                .chromeEventHandler;
}
```
}