Comment 75 for bug 572074

Revision history for this message
In , Dao+bmo (dao+bmo) wrote :

Comment on attachment 8781962
middlemouse on new tab button should create a new tab related to current,

> function BrowserOpenNewTabOrWindow(event) {
>- if (event.shiftKey) {
>+ let where = whereToOpenLink(event);
>+ if (where == "window") {
> OpenBrowserWindow();
> } else {
>- BrowserOpenTab();
>+ // Make new tab related to current except when created via a shortcut <key> command.

This comment doesn't seem accurate, e.g. we don't want to open the tab related to the current one for plain clicks... right?

>+ let sourceNotKeyEvent = !event.sourceEvent || event.sourceEvent.target.localName != "key";
>+ let relatedToCurrent = (where == "tab" || where == "tabshifted") && sourceNotKeyEvent;
>+ openUILinkIn(BROWSER_NEW_TAB_URL, "tab", {relatedToCurrent,
>+ inBackground: where == "tabshifted"});

I'm somewhat confused by this. Why are you not passing through "tabshifted" as openUILinkIn's 'where' argument?