forked from mirrors/gecko-dev
DocShells are associated with outer DOM Windows, rather than Documents, so having the getter on the document is a bit odd to begin with. But it's also considerably less convenient, since most of the times when we want a docShell from JS, we're dealing most directly with a window, and have to detour through the document to get it. MozReview-Commit-ID: LUj1H9nG3QL --HG-- extra : source : fcfb99baa0f0fb60a7c420a712c6ae7c72576871 extra : histedit_source : 5be9b7b29a52a4b8376ee0bdfc5c08b12e3c775a
15 lines
443 B
JavaScript
15 lines
443 B
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
var EXPORTED_SYMBOLS = [
|
|
"getChromeWindow"
|
|
];
|
|
|
|
// Get the chrome (ie, browser) window hosting this content.
|
|
function getChromeWindow(window) {
|
|
return window.docShell.rootTreeItem.domWindow
|
|
.wrappedJSObject;
|
|
}
|