Closed Bug 581242 Opened 14 years ago Closed 14 years ago

The Addons Manager should open in the current tab if that tab is blank.

Categories

(Firefox :: General, defect)

defect
Not set
trivial

Tracking

()

VERIFIED FIXED
Firefox 4.0b4

People

(Reporter: hawkrives, Assigned: sindrebugzilla)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b3pre) Gecko/20100722 Minefield/4.0b3pre
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b3pre) Gecko/20100722 Minefield/4.0b3pre

I usually forget that the addons manager opens itself in a new tab, so I end up making a new tab first, then opening it. However, the addons manager then opens itself into yet another tab. It would be nice if it could use the current tab if the current tab is blank.

Reproducible: Always

Steps to Reproduce:
1. Open a new tab.
2. Open the Add-ons Manager
Actual Results:  
You now have at least two tabs open, one that is blank and one with the addons manager.

Expected Results:  
You would only have one tab, the one with the addons manager.
Confirm this bug exists in trunk builds with Windows, likely exists in Linux as well; not an issue in 3.6 branch since this is a new feature.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → Trunk
Yes, and "Release Notes" in the Help Menu should act the same!
Depends on: 320989
Dao, is this a tabbrowser or add-ons manager bug?
It is not an add-ons manager bug.
Attached patch Proposed patch + test (obsolete) — Splinter Review
Proposed patch: switchToTabHavingURI opens aURI in current tab when aURI isn't already open and the current tab is empty.

The test confirms that:
1. Tab doesn't change when calling BrowserOpenAddonsMgr() and current tab is empty.
2. about:addons loads in current tab
Attachment #462410 - Flags: review?(dao)
Comment on attachment 462410 [details] [diff] [review]
Proposed patch + test

This patch is randomly using \t, please use spaces instead. Also, "if(" should be "if (" and "someFunction( foo )" should be "someFunction(foo)".
Attachment #462410 - Flags: review?(dao)
Attached patch Patch v2 (obsolete) — Splinter Review
Attachment #462410 - Attachment is obsolete: true
Attachment #462445 - Flags: review?(dao)
Comment on attachment 462445 [details] [diff] [review]
Patch v2

>+    if (isTabEmpty(gBrowser.selectedTab))
>+      gBrowser.selectedBrowser.loadURI(aURI.spec, null, null);

", null, null" can be omitted.

>+ * Portions created by the Initial Developer are Copyright (C) 2009

2010?

>+  gBrowser.selectedBrowser.addEventListener("load", function() {
>+      let browser = blanktab.linkedBrowser;
>+      is(browser.currentURI.spec, "about:addons", "about:addons should load into blank tab.");
>+      gBrowser.removeTab(blanktab);
>+      finish();
>+    }, true);

nit: reduce the indentation in the last five lines by two spaces each

Looks good overall. Thanks!
Attachment #462445 - Flags: review?(dao) → review+
Assignee: nobody → sindrebugzilla
Component: Tabbed Browser → General
QA Contact: tabbed.browser → general
Attached patch Patch v3Splinter Review
Attachment #462445 - Attachment is obsolete: true
Attachment #462492 - Flags: review?(dao)
Attachment #462492 - Flags: review?(dao)
Attachment #462492 - Flags: review+
Attachment #462492 - Flags: approval2.0?
Keywords: checkin-needed
This needs approval2.0+ before it can land.
Keywords: checkin-needed
Comment on attachment 462492 [details] [diff] [review]
Patch v3

a=me
Attachment #462492 - Flags: approval2.0? → approval2.0+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/66474ee346e7
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 4.0b4
So what should be the correct behavior if the Add-ons Manager is already open and you repeat the steps from comment 0? The blank tab you have selected gets closed and the Add-ons Manager tab focused. Do we really want to close the blank tab?
(In reply to comment #15)
> So what should be the correct behavior if the Add-ons Manager is already open
> and you repeat the steps from comment 0? The blank tab you have selected gets
> closed and the Add-ons Manager tab focused. Do we really want to close the
> blank tab?

Yes, you do. We already have a prior implementation of this, the switch-to-tab-via-awesome-bar. If you type the name of a tab into a blank tab, it will switch to that tab and close the blank tab. The user therefore might already expect this behavior.
Sounds reasonable. Marking as verified fixed with Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b5pre) Gecko/20100825 Minefield/4.0b5pre
Status: RESOLVED → VERIFIED
So what about situations when a notification is queued and the icon is visible in the notification bar? In such a case we do not re-use the current blank tab. Gavin, what would be the correct behavior here?
(In reply to comment #18)
> So what about situations when a notification is queued and the icon is visible
> in the notification bar? In such a case we do not re-use the current blank tab.
> Gavin, what would be the correct behavior here?

Filed it as bug 592472.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: