mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 721777 - B2G should open new windows as new frames in Gaia r=bz,fabrice
This commit is contained in:
parent
217269b303
commit
70c7d0c9cb
@ -394,6 +394,15 @@ pref("layers.acceleration.force-enabled", true);
|
||||
pref("dom.screenEnabledProperty.enabled", true);
|
||||
pref("dom.screenBrightnessProperty.enabled", true);
|
||||
|
||||
// handle links targeting new windows
|
||||
// 1=current window/tab, 2=new window, 3=new tab in most recent window
|
||||
pref("browser.link.open_newwindow", 3);
|
||||
|
||||
// 0: no restrictions - divert everything
|
||||
// 1: don't divert window.open at all
|
||||
// 2: don't divert window.open with features
|
||||
pref("browser.link.open_newwindow.restriction", 0);
|
||||
|
||||
// Enable browser frame
|
||||
pref("dom.mozBrowserFramesEnabled", true);
|
||||
pref("dom.mozBrowserFramesWhitelist", "http://localhost:6666");
|
||||
@ -401,6 +410,7 @@ pref("dom.mozBrowserFramesWhitelist", "http://localhost:6666");
|
||||
// Temporary permission hack for WebSMS
|
||||
pref("dom.sms.enabled", true);
|
||||
pref("dom.sms.whitelist", "file://,http://localhost:6666");
|
||||
|
||||
// Ignore X-Frame-Options headers.
|
||||
pref("b2g.ignoreXFrameOptions", true);
|
||||
|
||||
|
@ -225,6 +225,10 @@ var shell = {
|
||||
case 'load':
|
||||
this.home.removeEventListener('load', this, true);
|
||||
this.turnScreenOn();
|
||||
|
||||
let chromeWindow = window.QueryInterface(Ci.nsIDOMChromeWindow);
|
||||
chromeWindow.browserDOMWindow = new nsBrowserAccess();
|
||||
|
||||
this.sendEvent(window, 'ContentStart');
|
||||
break;
|
||||
case 'MozApplicationManifest':
|
||||
@ -356,3 +360,34 @@ MozKeyboard.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function nsBrowserAccess() {
|
||||
}
|
||||
|
||||
nsBrowserAccess.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserDOMWindow]),
|
||||
|
||||
openURI: function openURI(uri, opener, where, context) {
|
||||
// TODO This should be replaced by an 'open-browser-window' intent
|
||||
let contentWindow = content.wrappedJSObject;
|
||||
if (!('getApplicationManager' in contentWindow))
|
||||
return null;
|
||||
|
||||
let applicationManager = contentWindow.getApplicationManager();
|
||||
if (!applicationManager)
|
||||
return null;
|
||||
|
||||
let url = uri ? uri.spec : 'about:blank';
|
||||
let window = applicationManager.launch(url, where);
|
||||
return window.contentWindow;
|
||||
},
|
||||
|
||||
openURIInFrame: function openURIInFrame(uri, opener, where, context) {
|
||||
throw new Error('Not Implemented');
|
||||
},
|
||||
|
||||
isTabContentWindow: function isTabContentWindow(contentWindow) {
|
||||
return contentWindow == window;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user