Closed Bug 656105 Opened 13 years ago Closed 13 years ago

Opening links in a new tab does not activate the tab

Categories

(Other Applications :: ChatZilla, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla-mozilla-20000923, Assigned: bugzilla-mozilla-20000923)

References

(Depends on 1 open bug)

Details

(Whiteboard: [cz-0.9.87])

Attachments

(1 file)

In Firefox 4, at least, /goto-url-newtab is not focusing the tab unless the Firefox Tabs option "When I open a link in a new tab, switch to it immediately" is selected (not default). We should use a newer API or figure out how to focus the tab reliably.
So far the best I've come up with is:

window.gBrowser.selectedTab = window.gBrowser.addTab(uriString);

All the normal functions, including FUEL, follow the preference, meaning the tab will not be focused by default.

It really needs to work like OS default browser URL opening in terms of behaviour (but without going via the OS).
And right after posting that, I find it, sigh.

openUILinkIn(uriString, "tab");

This comes from chrome://browser/content/utilityOverlay.js, which we include for FF, and deals with focusing in all cases - and focusing the window. We can also use openUILinkIn(uriString, "window") for /goto-url-newwin. Excellent.
Assignee: rginda → silver
Status: NEW → ASSIGNED
Attachment #532444 - Flags: review?(samuel)
Attachment #532444 - Flags: review?(samuel) → review+
http://hg.mozilla.org/chatzilla/rev/5f59aea55af6
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.87]
Depends on: 687124
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: