mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-03 11:15:46 +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:
@@ -602,6 +602,7 @@ const liberator = (function () //{{{
|
|||||||
NEW_TAB: 2,
|
NEW_TAB: 2,
|
||||||
NEW_BACKGROUND_TAB: 3,
|
NEW_BACKGROUND_TAB: 3,
|
||||||
NEW_WINDOW: 4,
|
NEW_WINDOW: 4,
|
||||||
|
NEW_BACKGROUND_WIN_TAB: 6,
|
||||||
|
|
||||||
forceNewTab: false,
|
forceNewTab: false,
|
||||||
|
|
||||||
@@ -1123,6 +1124,17 @@ const liberator = (function () //{{{
|
|||||||
.loadURI(url, null, postdata);
|
.loadURI(url, null, postdata);
|
||||||
break;
|
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:
|
default:
|
||||||
throw Error("Invalid 'where' directive in liberator.open(...)");
|
throw Error("Invalid 'where' directive in liberator.open(...)");
|
||||||
}
|
}
|
||||||
@@ -1136,7 +1148,10 @@ const liberator = (function () //{{{
|
|||||||
for (let [i, url] in Iterator(urls))
|
for (let [i, url] in Iterator(urls))
|
||||||
{
|
{
|
||||||
open(url, where);
|
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;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user