36 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
39 this._tabBrowser = aTabBrowser;
40 this.wrappedJSObject =
this;
46 openURI:
function BrowserDOMWindow_openURI(aURI, aOpener, aWhere, aContext) {
48 if (aURI instanceof Components.interfaces.nsIURI)
52 var newTab = this._tabBrowser.addTab(
"about:blank",
null,
null,
null,
true,
false);
53 var newWindow = this._tabBrowser
54 .getBrowserForTab(newTab)
56 .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
57 .getInterface(Components.interfaces.nsIDOMWindow);
59 var loadflags = (aContext == Components.interfaces.nsIBrowserDOMWindow.OPEN_EXTERNAL) ?
60 Components.interfaces.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL :
61 Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;
64 Components.classes[
"@mozilla.org/network/io-service;1"]
65 .getService(Components.interfaces.nsIIOService)
66 .newURI(aOpener.location,
null,
null);
70 newWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
71 .getInterface(Components.interfaces.nsIWebNavigation)
72 .loadURI(aURI, loadflags, referrer,
null,
null);
76 var loadInBackground = this._tabBrowser
78 .getBoolPref(
"browser.tabs.loadDivertedInBackground");
79 if (!loadInBackground) {
80 this._tabBrowser.selectedTab = newTab;
85 isTabContentWindow:
function BrowserDOMWindow_isTabContentWindow(aWindow) {
86 for (var ctr = 0; ctr < this._tabBrowser.browsers.length; ctr++)
87 if (this._tabBrowser.browsers.item(ctr).contentWindow == aWindow)
92 QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIBrowserDOMWindow])
sbOSDControlService prototype QueryInterface
function BrowserDOMWindow(aTabBrowser)