From 4a93ab5af6f3f81d63634ba0a3a0f6db3a758c0a Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Sat, 20 Oct 2007 14:00:59 +0000 Subject: [PATCH] Bug 397807 "Get Extensions" etc. should respect external tab opening prefs r=jag --- suite/browser/nsBrowserContentListener.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/suite/browser/nsBrowserContentListener.js b/suite/browser/nsBrowserContentListener.js index c0df6dcdf9b..8fb5c833900 100644 --- a/suite/browser/nsBrowserContentListener.js +++ b/suite/browser/nsBrowserContentListener.js @@ -118,6 +118,12 @@ nsBrowserContentListener.prototype = { // forward the doContent to our content area webshell var docShell = this.contentWindow.docShell; + if (pref.getIntPref("browser.link.open_external") == nsIBrowserDOMWindow.OPEN_NEWTAB) { + var newTab = gBrowser.addTab("about:blank", null, null, + !pref.getBoolPref("browser.tabs.loadDivertedInBackground")); + docShell = gBrowser.getBrowserForTab(newTab).docShell; + } + var contentListener; try { contentListener = @@ -135,6 +141,9 @@ nsBrowserContentListener.prototype = isPreferred: function(contentType, desiredContentType) { + if (pref.getIntPref("browser.link.open_external") == nsIBrowserDOMWindow.OPEN_NEWWINDOW) + return false; + try { var webNavInfo = Components.classes["@mozilla.org/webnavigation-info;1"]