Provide a way to open a link into private browsing mode

RESOLVED FIXED in Firefox 20

Status

()

Firefox
Private Browsing
--
enhancement
RESOLVED FIXED
9 years ago
5 years ago

People

(Reporter: u88484, Assigned: Ehsan)

Tracking

Trunk
Firefox 20
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

9 years ago
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.
(Reporter)

Comment 2

9 years ago
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.
(Reporter)

Comment 4

9 years ago
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

Comment 6

9 years ago
Will be good to have bookmark property like "always open this link in private mode"
(Reporter)

Comment 7

9 years ago
(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.

Comment 8

9 years ago
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: 248970
Depends on: 248970

Comment 10

9 years ago
Context menu item (on link) can be also considered (key shortcut would not be discoverable by the new users).
(Reporter)

Comment 11

9 years ago
(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
Last Resolved: 9 years ago
Resolution: --- → WONTFIX

Comment 15

9 years ago
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.
(Reporter)

Updated

8 years ago
Duplicate of this bug: 490593
Keywords: uiwanted

Updated

8 years ago
Depends on: 463027
No longer depends on: 248970

Updated

8 years ago
Depends on: 248970
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: 463027

Comment 18

6 years ago
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.

Updated

6 years ago
Status: RESOLVED → REOPENED
Depends on: 463027
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.  :-)

Updated

5 years ago
Depends on: 729865
Created attachment 685624 [details] [diff] [review]
Patch (v1)

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)
https://tbpl.mozilla.org/?tree=Try&rev=3a343f1f43c7
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

Updated

5 years ago
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.
Created attachment 686103 [details] [diff] [review]
Patch (v2)

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+

Updated

5 years ago
Keywords: uiwanted

Updated

5 years ago
Blocks: 463027, 729865
No longer depends on: 463027, 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.
https://hg.mozilla.org/integration/mozilla-inbound/rev/6838e8bc3ce8
(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.
Follow-up: https://hg.mozilla.org/integration/mozilla-inbound/rev/55b884987542
https://hg.mozilla.org/mozilla-central/rev/6838e8bc3ce8
https://hg.mozilla.org/mozilla-central/rev/55b884987542
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20

Comment 36

5 years ago
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.

Updated

5 years ago
Whiteboard: [parity-chrome] → [parity-chrome][testday-20130104]

Comment 37

5 years ago
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.