From 3befa0120ba392b4c6fbf700608f77b37e32d83e Mon Sep 17 00:00:00 2001 From: Ted Pavlic Date: Sun, 4 Jan 2009 21:49:08 -0500 Subject: [PATCH] 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 --- common/content/liberator.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index 13d5089e..a8b3ed6e 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -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;