Closed Bug 463582 Opened 11 years ago Closed 11 years ago

Private browsing menu item does not work with no browser windows open

Categories

(Firefox :: Private Browsing, defect, minor)

All
macOS
defect
Not set
minor

Tracking

()

VERIFIED FIXED
Firefox 3.6a1

People

(Reporter: ajlyon+bugmail, Assigned: ehsan)

References

Details

(Keywords: verified1.9.1)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.1b2pre) Gecko/20081106 Minefield/3.1b2pre
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.1b2pre) Gecko/20081106 Minefield/3.1b2pre

When I have no browser windows open, the "Private Browsing" item in the Tools menu does nothing.

Reproducible: Always

Steps to Reproduce:
1. Enter private browsing mode.
2. Close all browser windows.
3. Select "Private Browsing" from the Tools menu.
Actual Results:  
No action.

Expected Results:  
The browser should restore what I had open before entering private browsing mode.

All it takes to leave private browsing mode is to open a window and use the menu item.
Status: UNCONFIRMED → NEW
Component: Menus → General
Ever confirmed: true
QA Contact: menus → general
Marcia: can you confirm this on a Mac?  If yes, can you please see if anything's logged on the console?
Keywords: qawanted
Version: unspecified → Trunk
Assignee: nobody → ehsan.akhgari
Status: NEW → ASSIGNED
Confirming.  This is a two way problem that will hit the user - in the beginning if they close all browser windows and try to launch into PB nothing happens, and as the reporter notes when they try to exit PB mode the same issue will happenm since on the Mac it is possible to close the windows and still have the menu items show.
Mass moving of all Firefox::General private browsing bugs to Firefox::Private Browsing.
Component: General → Private Browsing
QA Contact: general → private.browsing
Ehsan, while doing the above steps I can see following entry within the Error Console:

Error: this._privateBrowsingService is null
Source File: chrome://browser/content/browser.js
Line: 8611

Probably that happen because we don't have any window which holds an instance? Ehsan, do you need more information to solve this problem?

With the given STR the feature cannot be used. Even that it will not happen as often, I'll ask for blocking1.9.1.
Flags: blocking-firefox3.1?
Hardware: PowerPC → All
(In reply to comment #4)
> Ehsan, while doing the above steps I can see following entry within the Error
> Console:
> 
> Error: this._privateBrowsingService is null
> Source File: chrome://browser/content/browser.js
> Line: 8611
> 
> Probably that happen because we don't have any window which holds an instance?
> Ehsan, do you need more information to solve this problem?

I guess it'd help if you can paste the exact lines on which it's failing from browser.js here.  But I think I know why this doesn't work, and how to fix it.  :-)
Whiteboard: [PB todo]
Sure. It's the last function (getter method) in browser.js:

  get privateBrowsingEnabled PBUI_get_privateBrowsingEnabled() {
=>  return this._privateBrowsingService.privateBrowsingEnabled;
  }
Looks like gPrivateBrowsingUI.init() isn't being called in nonBrowserWindowDelayedStartup().
Keywords: qawanted
Whiteboard: [PB todo]
Attached patch Patch (v1)Splinter Review
Init and uninit the PB UI object in Mac for cases with no window open.
Attachment #355564 - Flags: review?(gavin.sharp)
Attachment #355564 - Flags: review?(gavin.sharp) → review+
Flags: in-litmus?
Landed on mozilla-central: <http://hg.mozilla.org/mozilla-central/rev/a32d4db772d2>
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.2a1
Attachment #355564 - Flags: approval1.9.1?
verified fixed on the trunk using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090113 Minefield/3.2a1pre as well as the equivalent build on 10.4.11.  After closing the browser window, I can now stop the private browsing session from the Tools menu and resume where I left off.
Status: RESOLVED → VERIFIED
https://litmus.mozilla.org/show_test.cgi?id=7458 added to Litmus.
Flags: in-litmus? → in-litmus+
One remaining question. When I've started PB mode in a window-less mode I expect to also land there. Instead the former session is opened and the window with all tabs is displayed. Ehsan, is that really wanted?
(In reply to comment #12)
> One remaining question. When I've started PB mode in a window-less mode I
> expect to also land there. Instead the former session is opened and the window
> with all tabs is displayed. Ehsan, is that really wanted?

Not really.  Can you please file a new bug on that?
Comment on attachment 355564 [details] [diff] [review]
Patch (v1)

a191=beltzner
Attachment #355564 - Flags: approval1.9.1? → approval1.9.1+
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/fe71edbb2925
Flags: blocking-firefox3.1?
Keywords: fixed1.9.1
Verified with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090115 Shiretoko/3.1b3pre Ubiquity/0.1.4 ID:20090115020658

Further I found a bug which shows inconsistent PB stats. I'll add it to the dependency list.
You need to log in before you can comment on or make changes to this bug.