diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 637fcf6b25d..d57d0ca4b4f 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2526,7 +2526,7 @@ nsDocShell::Create() // so read it in once here and be done with it... mPrefs->GetBoolPref("network.protocols.useSystemDefaults", &mUseExternalProtocolHandler); - mPrefs->GetBoolPref("browser.target_new_blocked", &mDisallowPopupWindows); + mPrefs->GetBoolPref("browser.block.target_new_window", &mDisallowPopupWindows); mPrefs->GetBoolPref("browser.frames.enabled", &mAllowSubframes); // Check pref to see if we should prevent frameset spoofing diff --git a/mozilla/modules/libpref/src/init/all.js b/mozilla/modules/libpref/src/init/all.js index 755ce0f1051..10d61ff4098 100644 --- a/mozilla/modules/libpref/src/init/all.js +++ b/mozilla/modules/libpref/src/init/all.js @@ -158,7 +158,7 @@ pref("browser.PICS.reenable_for_this_session", false); pref("browser.PICS.service.http___home_netscape_com_default_rating.service_enabled", true); pref("browser.PICS.service.http___home_netscape_com_default_rating.s", 0); -pref("browser.target_new_blocked", false); +pref("browser.block.target_new_window", false); // loading and rendering of framesets and iframes pref("browser.frames.enabled", true); diff --git a/mozilla/xpfe/components/prefwindow/resources/content/pref-scripts.js b/mozilla/xpfe/components/prefwindow/resources/content/pref-scripts.js index d5c15224811..0df91ec9a38 100644 --- a/mozilla/xpfe/components/prefwindow/resources/content/pref-scripts.js +++ b/mozilla/xpfe/components/prefwindow/resources/content/pref-scripts.js @@ -19,6 +19,7 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): + * Jonas Jørgensen * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -43,6 +44,10 @@ function doAllowWindowOpen(){ data.scriptData["allowWindowOpenChanged"].value = !data.scriptData["allowWindowOpenChanged"].value; } +function doAllowTargetNew(){ + data.scriptData["allowTargetNewChanged"].value = !data.scriptData["allowTargetNewChanged"].value; +} + function doWindowMoveResize(){ data.scriptData["allowWindowMoveResizeChanged"].value = !data.scriptData["allowWindowMoveResizeChanged"].value; } @@ -115,10 +120,10 @@ function Startup(){ //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ - var changedList = ["allowWindowOpenChanged", "allowWindowMoveResizeChanged", - "allowWindowStatusChangeChanged", "allowWindowFlipChanged", - "allowDocumentCookieSetChanged", "allowDocumentCookieGetChanged", - "allowImageSrcChangeChanged"]; + var changedList = ["allowWindowOpenChanged", "allowTargetNewChanged", + "allowWindowMoveResizeChanged", "allowWindowStatusChangeChanged", + "allowWindowFlipChanged", "allowDocumentCookieSetChanged", + "allowDocumentCookieGetChanged", "allowImageSrcChangeChanged"]; data.scriptData = []; for(var run = 0; run < changedList.length; run++ ){ data.scriptData[ changedList[run] ] = []; @@ -133,6 +138,14 @@ function Startup(){ document.getElementById("allowWindowOpen").checked = true; } + try{ + document.getElementById("allowTargetNew").checked = + !pref.GetBoolPref("browser.block.target_new_window"); + } catch (e){ + //We will only get an error if the preference doesn't exist, when that happens we default to true + document.getElementById("allowTargetNew").checked = true; + } + //If one of the security capability prefs is set, then the checkbox becomes unchecked document.getElementById("allowWindowMoveResize").checked = getPrefValueForCheckbox("capability.policy.default.Window.resizeTo") && @@ -167,6 +180,8 @@ function Startup(){ document.getElementById("allowWindowOpen").checked = data["allowWindowOpen"].checked; + document.getElementById("allowTargetNew").checked = data["allowTargetNew"].checked; + document.getElementById("allowWindowMoveResize").checked = data["allowWindowMoveResize"].checked; document.getElementById("allowWindowFlip").checked = data["allowWindowFlip"].checked; @@ -226,6 +241,11 @@ function doOnOk(){ !getCheckboxValue('allowWindowOpen')); } + if (data.scriptData["allowTargetNewChanged"].value){ + parent.hPrefWindow.setPref("bool", "browser.block.target_new_window", + !getCheckboxValue('allowTargetNew')); + } + if (data.scriptData["allowWindowMoveResizeChanged"].value){ var allowWindowMoveResize = getCheckboxValue("allowWindowMoveResize"); diff --git a/mozilla/xpfe/components/prefwindow/resources/content/pref-scripts.xul b/mozilla/xpfe/components/prefwindow/resources/content/pref-scripts.xul index ca127534abe..9caec91bb2f 100644 --- a/mozilla/xpfe/components/prefwindow/resources/content/pref-scripts.xul +++ b/mozilla/xpfe/components/prefwindow/resources/content/pref-scripts.xul @@ -37,7 +37,13 @@ - + +%brandDTD; + +%prefScriptsDTD; +]> + @@ -45,7 +51,7 @@ @@ -64,6 +70,9 @@ + + + diff --git a/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-scripts.dtd b/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-scripts.dtd index ebbb4ca7a1e..91e2b0accdd 100644 --- a/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-scripts.dtd +++ b/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-scripts.dtd @@ -3,13 +3,14 @@ - + - + +