1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-08 18:24:13 +01:00

Fixed ":winopen a, b, c" so that a, b, and c all open in the new window.

Before, only a opened in the new window. b and c opened in background
tabs.

Please review this patch. Feel free to refactor or revert. I'm not
entirely comfortable with the solution, but it was small.

Bug reported in http://vimperator.org/trac/ticket/119
This commit is contained in:
Ted Pavlic
2009-01-04 21:49:08 -05:00
parent bc0c985a49
commit 3befa0120b

View File

@@ -602,6 +602,7 @@ const liberator = (function () //{{{
NEW_TAB: 2,
NEW_BACKGROUND_TAB: 3,
NEW_WINDOW: 4,
NEW_BACKGROUND_WIN_TAB: 6,
forceNewTab: false,
@@ -1123,6 +1124,17 @@ const liberator = (function () //{{{
.loadURI(url, null, postdata);
break;
case liberator.NEW_BACKGROUND_WIN_TAB:
if (!liberator.has("tabs"))
return open(urls, liberator.NEW_WINDOW);
options.withContext(function () {
options.setPref("browser.tabs.loadInBackground", true);
services.get("windowMediator").getMostRecentWindow("navigator:browser")
.getBrowser().loadOneTab(url, null, null, postdata, true);
});
break;
default:
throw Error("Invalid 'where' directive in liberator.open(...)");
}
@@ -1136,7 +1148,10 @@ const liberator = (function () //{{{
for (let [i, url] in Iterator(urls))
{
open(url, where);
where = liberator.NEW_BACKGROUND_TAB;
if( liberator.NEW_WINDOW == where || liberator.NEW_BACKGROUND_WIN_TAB == where )
where = liberator.NEW_BACKGROUND_WIN_TAB;
else
where = liberator.NEW_BACKGROUND_TAB;
}
return true;