Closed Bug 1457109 Opened 4 years ago Closed 3 years ago

Link opens at the end of the tabbar

Categories

(DevTools :: Console, enhancement, P3)

enhancement

Tracking

(firefox61 wontfix, firefox67 fixed)

RESOLVED FIXED
Firefox 67
Tracking Status
firefox61 --- wontfix
firefox67 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

originally opened in https://github.com/devtools-html/devtools-core/issues/760

Open at least 2 tabs in a window, focus the left one, and enter this into the console:
```js
"http://example.com"
```

Click the resulting link. The new tab opens at the end of the tabbar instead of just at the right of the current tab.
Priority: -- → P3
Product: Firefox → DevTools

I think that's the default browser behavior (you can install extension to change that). Closing.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX

This is the default when you don't specify an opener tab. Otherwise the default is opening next to the selected tab (or its last related tab).

Effectively, extensions can change the browser.tabs.insertRelatedAfterCurrent, but I already have it set to true (the default behavior).

This is devtools fault for not specifying the opener tab.

It's very annoying when I have lots of open tabs (2714 right now), and my current tab is neither at the start nor end. Then I lose track of where I was.

Sorry about that Oriol.
I looked at it a bit better and the following diff makes things a lot better:

diff --git a/devtools/client/webconsole/webconsole.js b/devtools/client/webconsole/webconsole.js
--- a/devtools/client/webconsole/webconsole.js
+++ b/devtools/client/webconsole/webconsole.js
@@ -12,6 +12,7 @@ loader.lazyRequireGetter(this, "viewSour
 loader.lazyRequireGetter(this, "openDocLink", "devtools/client/shared/link", true);
 
 var gHudId = 0;
+const isMacOS = Services.appinfo.OS === "Darwin";
 
 /**
  * A WebConsole instance is an interactive console initialized *per target*
@@ -149,7 +150,10 @@ class WebConsole {
    *        The URL you want to open in a new tab.
    */
   openLink(link, e) {
-    openDocLink(link);
+    openDocLink(link, {
+      relatedToCurrent: true,
+      inBackground: isMacOS ? e.metaKey : e.ctrlKey,
+    });
   }
 
   /**

Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Assignee: nobody → nchevobbe
Status: REOPENED → ASSIGNED

This patch passes the relevant options to the openDocLink function,
which means now links:

  • will open right next to the current tab
  • will open in background if Ctrl/Cmd is pressed.

A test case is added to ensures this works as expected.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fb3cbe9457a9
Open links in the next tab, in background if Ctrl/Cmd is pressed; r=yulia.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
Duplicate of this bug: 1278842
You need to log in before you can comment on or make changes to this bug.