Closed Bug 456884 Opened 16 years ago Closed 12 years ago

Provide a way to open a link into private browsing mode

Categories

(Firefox :: Private Browsing, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 20

People

(Reporter: u88484, Assigned: ehsan.akhgari)

References

Details

(Whiteboard: [parity-chrome][testday-20130104])

Attachments

(1 file, 1 obsolete file)

Along with creating a private browsing mode, I think there should be a way to open a link into private browsing mode.  That way a user won't have to copy the link, go into private browsing mode and then paste the link.  

Unless I'm not understanding how private browsing mode is going to work.  Is it going to work like enter private browsing mode deletes all current cache but current tabs are still display (would this cause icons/pictures to be reloaded?) and then any subsequent browsing is not cached?
(In reply to comment #0)
> Along with creating a private browsing mode, I think there should be a way to
> open a link into private browsing mode.  That way a user won't have to copy the
> link, go into private browsing mode and then paste the link.  

User can choose to leave her current session open, and then after entering the private mode, just open the link as usual.  What you're suggesting would be *way* difficult to implement, because of the way that core code does not differentiate between individual page loads...

> Unless I'm not understanding how private browsing mode is going to work.  Is it
> going to work like enter private browsing mode deletes all current cache but
> current tabs are still display (would this cause icons/pictures to be
> reloaded?) and then any subsequent browsing is not cached?

It disables the disk cache, and empties the memory cache on entering.  Nothing gets reloaded.  Any subsequent browsing is only cached in memory, and never cached on disk.
I'm suggesting something like ctrl+shift+clicking on a link would open that link in a new tab in private browsing mode instead of toggling private browsing mode  and then clicking the link.  Just a simple shortcut.
(In reply to comment #2)
> I'm suggesting something like ctrl+shift+clicking on a link would open that
> link in a new tab in private browsing mode instead of toggling private browsing
> mode  and then clicking the link.  Just a simple shortcut.

I'm not quite sure if you mean per-tab private browsing mode, or just entering it with a shortcut such as Ctrl+Shift globally?  The former can't be done without major rearchitecture at the core level, but I think the latter can be considered.
At the very least the latter would be great.  It would just make it easier to toggle private browsing mode and open a link all at the same time without having to manually toggle private browsing mode (from a button/menu entry or whatever is going to be done there) and then clicking the link.  Since private browsing mode won't be per-tab, we won't be able to close said tab and "exit" private browsing mode but that should be fine.
I'm not sure if it's a good UI choice.  Let's hear from Beltzner on this.  Implementation-wise, it should be trivial both for Firefox and an extension.
Keywords: uiwanted
Will be good to have bookmark property like "always open this link in private mode"
(In reply to comment #6)
> Will be good to have bookmark property like "always open this link in private
> mode"
That would need to be spun off into another bug but to mean it would be completley pointless.  The user would want to not have any tracks at all so why would they have a bookmark to a site that they don't want their tracks being kept?  But lets leave the discussion to what this bug was started about.
It will be good in pair with any anonymizer.
This useful for sites I have to hide from: I use this site via anonymiser, and want not to give any chance to access to my history, sessions, etc.
(In reply to comment #8)
> It will be good in pair with any anonymizer.
> This useful for sites I have to hide from: I use this site via anonymiser, and
> want not to give any chance to access to my history, sessions, etc.

Just to make it clear, the private browsing mode doesn't help with keeping you anonymous to the websites you visit at all.  Its only job is to make sure no record of your visits are stored in your Firefox profile.
No longer blocks: PrivateBrowsing
Depends on: PrivateBrowsing
Context menu item (on link) can be also considered (key shortcut would not be discoverable by the new users).
(In reply to comment #10)
> Context menu item (on link) can be also considered (key shortcut would not be
> discoverable by the new users).

Ehsan, any easy way to implement this in an extension?  I have an extension right now to toggle between PB mode and to toggle the prefs.  I would like to add a context menu item that would open said link into private browsing mode.
(In reply to comment #11)
> Ehsan, any easy way to implement this in an extension?  I have an extension
> right now to toggle between PB mode and to toggle the prefs.  I would like to
> add a context menu item that would open said link into private browsing mode.

If the objective is to open a new tab/window in private mode for only that link (leaving the rest of windows/tabs in non-private mode), then no this can't be done from within an extension.

The best which can be achieved in an extension is to set the browser.privatebrowsing.keep_current_session pref to true (to prevent the current session from being saved and closed upon entering the private mode) and then set the privateBrowsingEnabled attribute to true just before opening the link in a new window/tab.

Note that this would switch the whole browser into the private browsing mode, and also note that browser.privatebrowsing.keep_current_session is a hidden and undocumented pref which we use mostly for testing purposes, and it might be removed in a future release (after 3.1, that is).
Mass moving of all Firefox::General private browsing bugs to Firefox::Private Browsing.
Component: General → Private Browsing
QA Contact: general → private.browsing
This feels like extension fodder at best.  It shouldn't be a context menu item, IMO.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
in google chrome this is a context menu option

can you make this depend on Bug 463027? with simultaneous private and regular windows, this request would be part of the natural workflow.
Keywords: uiwanted
Depends on: PBnGen
No longer depends on: PrivateBrowsing
Depends on: PrivateBrowsing
This has been WONTFIXed, so it should not depend on bug 463027.

If you have a compelling reason why we should support this, please re-open this bug with your rationale.
No longer depends on: PBnGen
once bug 463027 lands, this would be the natural mechanism to get to private browsing mode, for the specific link you don't want in history, as done in google chrome. can we reopen this?
(In reply to comment #18)
> once bug 463027 lands, this would be the natural mechanism to get to private
> browsing mode, for the specific link you don't want in history, as done in
> google chrome. can we reopen this?

I guess so.
Status: RESOLVED → REOPENED
Depends on: PBnGen
Resolution: WONTFIX → ---
Since now per window browsing is close to get a review+ , I think work on this bug should also be started.
IMO it is not a difficult task to do. But is very important when per-window pb lands. So this bug should also land along-side per window pb .
per window private browsing*
Yes, once bug 463027 is fixed, this will be very easy to do, and will be on the list of things we'll get to.  :-)
Depends on: 729865
Attached patch Patch (v1) (obsolete) — Splinter Review
This patch adds an "Open in new private window" menu item to the context menu for links.
Assignee: nobody → ehsan
Status: REOPENED → ASSIGNED
Attachment #685624 - Flags: review?(dao)
Please get this ui-reviewed.
Ehsan, can you maybe talk to Madhava and see if he or someone from the ux-team can help evaluate the benefits of this change vs. the cost of further cluttering the context menu? I don't know whether we have a UX point person for private browsing.
Keywords: uiwanted
Whiteboard: [parity-chrome]
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #26)
> Ehsan, can you maybe talk to Madhava and see if he or someone from the
> ux-team can help evaluate the benefits of this change vs. the cost of
> further cluttering the context menu? I don't know whether we have a UX point
> person for private browsing.

Sure, will do.
Attached patch Patch (v2)Splinter Review
This patch is a little bit better in that it hides "Open in new window" in private windows, since you cannot open a link from a private window into a non-private window.
Attachment #685624 - Attachment is obsolete: true
Attachment #685624 - Flags: review?(dao)
Attachment #686103 - Flags: ui-review?(madhava)
Attachment #686103 - Flags: review?(dao)
Attachment #686103 - Flags: ui-review?(madhava) → ui-review+
Comment on attachment 686103 [details] [diff] [review]
Patch (v2)

>@@ -262,8 +263,15 @@ function openLinkIn(url, where, params) {
>     sa.AppendElement(aPostData);
>     sa.AppendElement(allowThirdPartyFixupSupports);
> 
>+    let extraFeatures = "";
>+#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
>+    if (aIsPrivate) {
>+      extraFeatures = ",private";
>+    }
>+#endif
>+
>     Services.ww.openWindow(w || window, getBrowserURL(),
>-                           null, "chrome,dialog=no,all", sa);
>+                           null, "chrome,dialog=no,all" + extraFeatures, sa);

I'd prefer:

    let features = "chrome,dialog=no,all";
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
    if (aIsPrivate)
      features += ",private";
#endif
    Services.ww.openWindow(w || window, getBrowserURL(), null, features, sa);
Attachment #686103 - Flags: review?(dao) → review+
Keywords: uiwanted
Blocks: PBnGen, 729865
No longer depends on: PBnGen, 729865
>  // Currently, this parameter works only for where=="tab" or "current"
>  var aIsUTF8 = params.isUTF8;
>  var aInitiatingDoc = params.initiatingDoc;
>+ var aIsPrivate = params.private;
	
From this patch, you don't add the new argument to openLinkIn(). So I think this variable need not "a" prefix. So I seem 'isPrivate' is better.
(In reply to Tetsuharu OHZEKI [:saneyuki_s] from comment #30)
> >  // Currently, this parameter works only for where=="tab" or "current"
> >  var aIsUTF8 = params.isUTF8;
> >  var aInitiatingDoc = params.initiatingDoc;
> >+ var aIsPrivate = params.private;
> 	
> From this patch, you don't add the new argument to openLinkIn(). So I think
> this variable need not "a" prefix. So I seem 'isPrivate' is better.

That's not the prevailing style. All arguments, whether originating from the params object or not, have the "a" prefix.
(In reply to comment #32)
> (In reply to Tetsuharu OHZEKI [:saneyuki_s] from comment #30)
> > >  // Currently, this parameter works only for where=="tab" or "current"
> > >  var aIsUTF8 = params.isUTF8;
> > >  var aInitiatingDoc = params.initiatingDoc;
> > >+ var aIsPrivate = params.private;
> > 	
> > From this patch, you don't add the new argument to openLinkIn(). So I think
> > this variable need not "a" prefix. So I seem 'isPrivate' is better.
> 
> That's not the prevailing style. All arguments, whether originating from the
> params object or not, have the "a" prefix.

Oops, I actually addressed this comment.  Will push a patch to fix the style right now.
https://hg.mozilla.org/mozilla-central/rev/6838e8bc3ce8
https://hg.mozilla.org/mozilla-central/rev/55b884987542
Status: ASSIGNED → RESOLVED
Closed: 15 years ago12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
2013-01-04-03-08-23-mozilla-central-firefox-20.0a1.en-US.linux-x86_64 — the item in a link’s context menu opens the link in a window with “(Private Browsing)” in title and “Clear Recent History” disabled. Verified.
Whiteboard: [parity-chrome] → [parity-chrome][testday-20130104]
how does this work with regard to referrer? (bug 467257)
(In reply to comment #37)
> how does this work with regard to referrer? (bug 467257)

The Referrer header is sent.
Is it intended that links in Library window (History & Bookmarks) and Bookmarks Toolbar have no option to open them in Private window?
(In reply to Virtual_ManPL [:Virtual] from comment #39)
> Is it intended that links in Library window (History & Bookmarks) and
> Bookmarks Toolbar have no option to open them in Private window?

That's bug 821724.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: