зеркало из https://github.com/mozilla/pjs.git
Fixing bug 319879, loading bookmarks with keywords doesn't allow popups. Patch by froodian <stridey@gmail.com>, r=smorgan, sr=pink
This commit is contained in:
Родитель
234a311edb
Коммит
be9cdfe309
|
@ -658,9 +658,7 @@ static BookmarkManager* gBookmarkManager = nil;
|
|||
}
|
||||
resolvedArray = [[self rootBookmarks] resolveKeyword:firstWord withArgs:secondWord];
|
||||
}
|
||||
if (resolvedArray)
|
||||
return resolvedArray;
|
||||
return [NSArray arrayWithObject:keyword];
|
||||
}
|
||||
|
||||
// a null container indicates to search all bookmarks
|
||||
|
|
|
@ -2053,26 +2053,28 @@ enum BWCOpenDest {
|
|||
// look for bookmarks keywords match
|
||||
NSArray *resolvedURLs = [[BookmarkManager sharedBookmarkManager] resolveBookmarksKeyword:theURL];
|
||||
|
||||
NSString* resolvedURL = nil;
|
||||
if ([resolvedURLs count] == 1) {
|
||||
resolvedURL = [resolvedURLs lastObject];
|
||||
NSString* targetURL = nil;
|
||||
if (!resolvedURLs || [resolvedURLs count] == 1) {
|
||||
targetURL = resolvedURLs ? [resolvedURLs lastObject] : theURL;
|
||||
BOOL allowPopups = resolvedURLs ? YES : NO; //Allow popups if it's a bookmark keyword
|
||||
if (inDest == kDestinationNewTab)
|
||||
[self openNewTabWithURL:resolvedURL referrer:nil loadInBackground:inLoadInBG allowPopups:NO setJumpback:NO];
|
||||
[self openNewTabWithURL:targetURL referrer:nil loadInBackground:inLoadInBG allowPopups:allowPopups setJumpback:NO];
|
||||
else if (inDest == kDestinationNewWindow)
|
||||
[self openNewWindowWithURL:resolvedURL referrer:nil loadInBackground:inLoadInBG allowPopups:NO];
|
||||
[self openNewWindowWithURL:targetURL referrer:nil loadInBackground:inLoadInBG allowPopups:allowPopups];
|
||||
else // if it's not a new window or a new tab, load into the current view
|
||||
[self loadURL:resolvedURL];
|
||||
} else {
|
||||
[self loadURL:targetURL referrer:nil focusContent:YES allowPopups:allowPopups];
|
||||
}
|
||||
else {
|
||||
if (inDest == kDestinationNewTab || inDest == kDestinationNewWindow)
|
||||
[self openURLArray:resolvedURLs tabOpenPolicy:eAppendTabs allowPopups:NO];
|
||||
[self openURLArray:resolvedURLs tabOpenPolicy:eAppendTabs allowPopups:YES];
|
||||
else
|
||||
[self openURLArray:resolvedURLs tabOpenPolicy:eReplaceTabs allowPopups:NO];
|
||||
[self openURLArray:resolvedURLs tabOpenPolicy:eReplaceTabs allowPopups:YES];
|
||||
}
|
||||
|
||||
// global history needs to know the user typed this url so it can present it
|
||||
// in autocomplete. We use the URI fixup service to strip whitespace and remove
|
||||
// invalid protocols, etc. Don't save keyword-expanded urls.
|
||||
if (resolvedURL && [theURL isEqualToString:resolvedURL] &&
|
||||
if (!resolvedURLs &&
|
||||
mDataOwner &&
|
||||
mDataOwner->mGlobalHistory &&
|
||||
mDataOwner->mURIFixer && [theURL length] > 0)
|
||||
|
|
Загрузка…
Ссылка в новой задаче