Comment on attachment 8642998 middlemouse on new tab button creates a new tab related to current
>+ // Make new tab related to current except for key commands >+ if (((where == "tab") || (where == "tabshifted")) && >+ (!event.sourceEvent || event.sourceEvent.target.localName != "key")) { >+ openUILinkIn(BROWSER_NEW_TAB_URL, "tab", {relatedToCurrent: true, >+ inBackground: where == "tabshifted"}); >+ } else if (where == "window") { > OpenBrowserWindow(); > } else { > BrowserOpenTab(); > } > }
Could this be simplified by also calling openUILinkIn in the default case instead of BrowserOpenTab? E.g.:
> if (where == "window") { > OpenBrowserWindow(); > } else { > let relatedToCurrent = (where == "tab" || where == "tabshifted") && > (!event.sourceEvent || event.sourceEvent.target.localName != "key"); > let inBackground = relatedToCurrent && where == "tabshifted"; > openUILinkIn(BROWSER_NEW_TAB_URL, "tab", {relatedToCurrent: relatedToCurrent, > inBackground: inBackground}); > }
I'm also not sure I understand the "except for key commands" logic. Is there no way to explicitly filter for mouse events here?
Comment on attachment 8642998
middlemouse on new tab button creates a new tab related to current
>+ // Make new tab related to current except for key commands nt.target. localName != "key")) { BROWSER_ NEW_TAB_ URL, "tab", {relatedToCurrent: true, ow();
>+ if (((where == "tab") || (where == "tabshifted")) &&
>+ (!event.sourceEvent || event.sourceEve
>+ openUILinkIn(
>+ inBackground: where == "tabshifted"});
>+ } else if (where == "window") {
> OpenBrowserWind
> } else {
> BrowserOpenTab();
> }
> }
Could this be simplified by also calling openUILinkIn in the default case instead of BrowserOpenTab? E.g.:
> if (where == "window") { ow(); nt.target. localName != "key"); BROWSER_ NEW_TAB_ URL, "tab", {relatedToCurrent: relatedToCurrent,
> OpenBrowserWind
> } else {
> let relatedToCurrent = (where == "tab" || where == "tabshifted") &&
> (!event.sourceEvent || event.sourceEve
> let inBackground = relatedToCurrent && where == "tabshifted";
> openUILinkIn(
> inBackground: inBackground});
> }
I'm also not sure I understand the "except for key commands" logic. Is there no way to explicitly filter for mouse events here?