Camino only: bug 346132 - Block Popup Windows By Default. r=hwaara sr=pink

This commit is contained in:
stridey%gmail.com 2006-09-22 19:47:05 +00:00
Родитель 4b203c498c
Коммит 84de1bd41c
3 изменённых файлов: 2 добавлений и 31 удалений

Просмотреть файл

@ -135,3 +135,5 @@ pref("camino.enable_tabjumpback", true);
// set the window.open behavior to "respect SWM unless the window.open call specifies size or features"
pref("browser.link.open_newwindow.restriction", 2);
// enable popup blocking
pref("dom.disable_open_during_load", true);

Двоичный файл не отображается.

Просмотреть файл

@ -897,37 +897,6 @@ static NSString* const kOfflineNotificationName = @"offlineModeChanged";
- (CHBrowserView*)createBrowserWindow:(unsigned int)aMask
{
BOOL showBlocker = [[PreferenceManager sharedInstance] getBooleanPref:"browser.popups.showPopupBlocker" withSuccess:NULL];
if (showBlocker) {
nsCOMPtr<nsIDOMWindow> domWindow = [mBrowserView getContentWindow];
nsCOMPtr<nsPIDOMWindow> piWindow(do_QueryInterface(domWindow));
if (piWindow->IsLoadingOrRunningTimeout()) {
// A popup is being opened while the page is currently loading. Offer to block the
// popup.
nsAlertController* controller = CHBrowserService::GetAlertController();
BOOL confirm = NO;
NS_DURING
confirm = [controller confirm:[self window]
title:NSLocalizedString(@"PopupBlockTitle",@"")
text:[NSString stringWithFormat:NSLocalizedString(@"PopupBlockMsg", @""), NSLocalizedStringFromTable(@"CFBundleName", @"InfoPlist", nil)]];
// This is a one-time dialog.
[[PreferenceManager sharedInstance] setPref:"browser.popups.showPopupBlocker" toBoolean:NO];
NS_HANDLER
NS_ENDHANDLER
if (confirm)
[[PreferenceManager sharedInstance] setPref:"dom.disable_open_during_load" toBoolean:YES];
[[PreferenceManager sharedInstance] savePrefsFile]; // really necessary?
if (confirm)
return nil;
}
}
BrowserWindowController* controller = [[BrowserWindowController alloc] initWithWindowNibName: @"BrowserWindow"];
[controller setChromeMask: aMask];
[controller disableAutosave]; // The Web page opened this window, so we don't ever use its settings.