Closed Bug 302352 Opened 19 years ago Closed 19 years ago

reuse blank foreground tab when opening external links

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 320989

People

(Reporter: ted, Assigned: ted)

References

Details

Attachments

(1 file)

If an external link would open a new tab, but the foreground tab is about:blank,
it should be reused instead of opening a new tab.

Patch in a minute.
Pretty trivial, if the current tab is about:blank and we're loading a url in a
new tab from an external source, just reuse the existing tab.
Comment on attachment 190720 [details] [diff] [review]
Reuse blank foreground tab instead of new tab

Adding to mconnor's insurmountable review queue.
Attachment #190720 - Flags: review?(mconnor)
Comment on attachment 190720 [details] [diff] [review]
Reuse blank foreground tab instead of new tab

thought I marked this, guess I just talked on IRC.

We should only reuse if its the last tab.  Also,
gBrowser.selectedBrowser.currentURI.spec === "about:blank" works too.
Attachment #190720 - Flags: review?(mconnor) → review-
If a script calls window.open("about:blank") and then adds to it using DOM 2
functions, will this code still treat it as a blank tab?
(In reply to comment #4)
> If a script calls window.open("about:blank") and then adds to it using DOM 2
> functions, will this code still treat it as a blank tab?

Jesse: do you have a working example I can test this with?
javascript:x=window.open("about:blank"); setTimeout(function() { x.document.body.appendChild(x.document.createTextNode("foo")); }, 1000); void 0
*** Bug 339005 has been marked as a duplicate of this bug. ***
Not that there's any more activity over on that other bug, but mconnor probably has a better chance of fixing this than I do currently.

*** This bug has been marked as a duplicate of 320989 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: