Closed Bug 780503 Opened 12 years ago Closed 6 years ago

Opening a "open-in-sidebar" bookmark in private mode also opens the website after restarting Firefox in normal mode.

Categories

(Firefox :: Private Browsing, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: b.smets, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
Build ID: 20120713134347

Steps to reproduce:

- Create a bookmark and check the "Open bookmark in side bar" option.
- Start private mode session > The private session correctly shows no open tabs.
- Open the bookmark > Side bar opens and shows the correct page.
- Close the private session and restart Firefox (default way.. not private-mode).


Actual results:

- Firefox opened in normal (non-private) mode.
- The bookmarked website was still open in the side bar.


Expected results:

- The side bar website shouldn't have opened, as it was accesssed in private mode.
(I access my bank website this way in private mode and always get freaked out when I see it is still open after restart in normal mode.)
Summary: Opening a "open-in-sidebar" bookmark in private mode also opens the website after restarting Firefox. → Opening a "open-in-sidebar" bookmark in private mode also opens the website after restarting Firefox in normal mode.
I cannot reproduce this Behavior against

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1 ID:20120713134347 and Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120805030518

I always get a blanked Tab (as intended in my Case) instead.
I can reproduce.

STR
1. Create two bookmark of different URL(A and B) and check the "Open bookmark in side bar" option for both bookmark(A and B).
2. Open a bookmark(A) -- (So, Url(A) is opened in the Sidebar)
3. Enter Private Browsing Mode
4. Open the other bookmark(B) -- (So, Url(B) is opened in the Sidebar)
5. Exit  Private Browsing Mode -- Observe content of sidebar

Actual Results:
  Url(B) is opened in the Sidebar

Expected Results:
  Url(A) should be opened in the Sidebar
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: Untriaged → Private Browsing
Version: 14 Branch → Trunk
Paul, Tim, do you guys know how the sessionstore handles this kind of thing?
The sidebar url isn't handled by sessionstore. It's persisted here:

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#1579

We could easily not persist it when we're exiting the browser in private browsing mode but we wouldn't be able to instead persist the URL from before entering PB mode.
(In reply to comment #4)
> The sidebar url isn't handled by sessionstore. It's persisted here:
> 
> http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#1579
> 
> We could easily not persist it when we're exiting the browser in private
> browsing mode but we wouldn't be able to instead persist the URL from before
> entering PB mode.

Why is that?
(and btw, the mxr link is no longer valid :( )
(In reply to Ehsan Akhgari [:ehsan] from comment #6)
> (and btw, the mxr link is no longer valid :( )

Meh.

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#1595

> document.persist("sidebar-box", "src");

I'm not sure how persist works we'd probably need to set the old URL from before entering PB mode again when closing the last window.
(In reply to comment #7)
> > document.persist("sidebar-box", "src");
> 
> I'm not sure how persist works we'd probably need to set the old URL from
> before entering PB mode again when closing the last window.

It seems to be using the browserstore.rdf crap: <http://mxr.mozilla.org/mozilla-central/source/content/xul/document/src/nsXULDocument.cpp#1360>

But still we should be able to keep the old value of the URL in memory and restore it when leaving the PB mode, right?
Oh wait, this only happens during shutdown, so we should just check to make sure that we don't persist the URL during shutdown, and that should be it.  Or am I missing something?
If we don't persist the URL during shutdown I think that means there's no URL persisted at all. So instead of the expected result from comment #2 we'd have no sidebar opened at all - which is probably less bad than showing a page from PB mode. We could always fix this as a follow-up.
Attached patch WIP (obsolete) — Splinter Review
So it's not as easy as what I thought it should look like, since by the time we uninit a window we have already switched out of the PB mode.

I have this patch which _should_ work except that I can't seem to get the URL of the thing opened in the sidebar no matter what I try to do in _saveAndCloseSideBar.  Tim, would you mind taking a look and see if you can make it work?

Thanks!
OS: Windows 7 → All
Hardware: x86_64 → All
Attached patch WIP v2Splinter Review
This patch restores the URL displayed before entering PB mode. I'm not entirely sure that's the right place to do it. SessionStore currently restores the _type_ of sidebar that's been displayed. That's enough for the history or bookmarks sidebar but obviously not enough for the webPanels stuff.

Shouldn't this rather be implemented in sessionstore itself?
Attachment #652239 - Attachment is obsolete: true
(In reply to comment #12)
> Shouldn't this rather be implemented in sessionstore itself?

That would be fine by me!
as a side note, note that from many years we are evaluating to kill the "open in sidebar" feature. Though Gavin can give you more details about reasoning.
"Load this bookmark in the sidebar" has now been removed in bug 1452645 so this is a wontfix.
Status: NEW → RESOLVED
Closed: 6 years ago
Depends on: 1452645
Resolution: --- → WONTFIX
(In reply to Alice0775 White from comment #2)
> I can reproduce.
> 
> STR
> 1. Create two bookmark of different URL(A and B) and check the "Open
> bookmark in side bar" option for both bookmark(A and B).
> 2. Open a bookmark(A) -- (So, Url(A) is opened in the Sidebar)
> 3. Enter Private Browsing Mode
> 4. Open the other bookmark(B) -- (So, Url(B) is opened in the Sidebar)
> 5. Exit  Private Browsing Mode -- Observe content of sidebar
> 
> Actual Results:
>   Url(B) is opened in the Sidebar
> 
> Expected Results:
>   Url(A) should be opened in the Sidebar

This steps are still reproducible with extensions see [1]. After step 4 both windows contain the same page in sidebar. But one sidebar is in private mode and the other one is normal mode (you can check this with some page you are logged into).

I guess expected result would be to have a separate sidebar for each window (when loading url to sidebar it should only load to the sidebar in that window). This would fix the problem reported.

[1] = https://addons.mozilla.org/en-US/firefox/addon/open-link-in-sidebar/
Hi Maciej, please could you file a separate bug under the WebExtensions product. Although the bookmark handling is similar to the sidebar for web extensions, it is different code, and would be better handled in a fresh bug, rather than reopening this one.
I guess I could, but that this does not a WebExtension problem and not even with bookmarks but with how the sidebar work. The problem seem to be that the sidebar has one context (session I guess). Similar can be seen with bookmarks view in the sidebar. Example:

1. Open two windows with two sidebars.
2. Open bookmarks menu in 1st window.
3. Open one of folders.
4. Close and open again sidebar in 2nd window.

Same things happens for history view (only state of one window is remembered).

But if you want to start working on this from scratch, then feel free to open new task and reference it.
I forgot to write what happens... I so wish bugzilla would have edits ;-)...

So after those steps the result is same state in both windows (in that case same state of opened folders). I guess you could consider this a feature not a bug, but I would expect sidebars not to synchronise state between windows. Personally I usually do separate work in separate windows.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: