diff --git a/common/content/tabs.js b/common/content/tabs.js index 22d90613..9a9b3e39 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -168,27 +168,29 @@ function Tabs() //{{{ // TODO: Is this really applicable to Xulmus? options.add(["popups", "pps"], "Where to show requested popup windows", - "number", 1, + "stringlist", "tab", { setter: function (value) { - let values = [[0, 1], // always in current tab - [0, 3], // in a new tab - [2, 3], // in a new window if it has specified sizes - [1, 2], // always in new window - [2, 1]];// current tab unless it has specified sizes - - options.safeSetPref("browser.link.open_newwindow.restriction", values[value][0]); - options.safeSetPref("browser.link.open_newwindow", values[value][1]); + let [open, restriction] = [1, 0]; + for (let [, opt] in value) + { + if (opt == "tab") + open = 3; + else if (opt == "window") + open = 2; + else if (opt == "resized") + resized = 2; + } + options.safeSetPref("browser.link.open_newwindow", open); + options.safeSetPref("browser.link.open_newwindow.restriction", resized); return value; }, completer: function (context) [ - ["0", "Force to open in the current tab"], - ["1", "Always open in a new tab"], - ["2", "Open in a new window if it has a specific requested size (default in " + config.hostApplication + ")"], - ["3", "Always open in a new window"], - ["4", "Open in the same tab unless it has a specific requested size"] + ["tab", "Open popups in a new tab"], + ["window", "Open popups in a new window"], + ["resized", "Open resized popups in a new window"] ], validator: Option.validateCompleter }); diff --git a/vimperator/NEWS b/vimperator/NEWS index a563dbca..82de544a 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -17,6 +17,7 @@ and are equivalent, to map the uppercase character use . (this might change again, as this is REALLY inconsistent, and i don't know if I like copying bugs) + * IMPORTANT: 'popups' now takes a stringlist rather than a number. * add [c]:keepalt[c] * add [c]:styledisable[c], [c]:styleenable[c], and [c]:styletoggle[c] diff --git a/vimperator/locale/en-US/options.txt b/vimperator/locale/en-US/options.txt index b7e4479d..18639bb0 100644 --- a/vimperator/locale/en-US/options.txt +++ b/vimperator/locale/en-US/options.txt @@ -613,7 +613,7 @@ ____ |\'pps'| |\'popups'| + -||'popups' 'pps'|| number (default: 1) +||'popups' 'pps'|| stringlist (default: tab) ____ Define where to show requested popup windows. Does not apply to windows which are opened by middle clicking a link, @@ -621,13 +621,15 @@ they always open in a new tab. Possible values: [frame="topbot",grid="none",cols="1,10"] |=============================================================================== -|*0*|Force to open in the current tab (Warning: this can stop some web sites from working correctly!) -|*1*|Always open in a new tab -|*2*|Open in a new window if it has a specific requested size (default in Firefox) -|*3*|Always open in a new window -|*4*|Open in the same tab unless it has a specific requested size +|*tab* | Open popups in a new tab +|*window* | Open popups in a new window +|*resized* | Open resized popups in a new window |=============================================================================== +If neither *tab* nor *window* is provided, all popups open in the current tab. +*tab* and *window* are mutually exclusive, and the last one listed is +effective. + Note: This option does not change the popup blocker of Firefox in any way. ____