Quantcast
Channel: Firefox: Set a specific link to always open in "private browsing" mode - Super User
Viewing all articles
Browse latest Browse all 2

Answer by LS97 for Firefox: Set a specific link to always open in "private browsing" mode

$
0
0

1. The easy, totally insecure answer

The closest I could find for your specific case (Firefox on Linux, local homepage) is to simply point the link to a shell script that incorporates the command you are using:

firefox -private-window http://www.somewhere.com/

For example, I made a test script on my desktop and was able to run it by using the link

file:///home/foobar/Desktop/test.sh

and then pointing Firefox to always open shell scripts with /bin/bash.

I cannot stress enough what a huge security risk this implies!! I'm only posting this because it's a valid solution to your question, but you probably shouldn't use it if the computer is connected to the internet in any way (which kind of defeats the point). The reason being, if Firefox is set up to open shell scripts automatically, any webpage exploiting this vulnerability in your system can gain unrestricted user access, well beyond what a regular browser allows.

To see what I mean, just take your pick on one of these commands* and imagine clicking a link that pointed to it. :)

(*) oh, but don't actually run them.

2. The (significantly) more technical but effective workaround
This is superuser.com, after all

Disclaimer: you may have a little too much fun working on this solution.

Stemming off of the first answer, this solution works wonders if you know a little bit of programming. As a bonus, it works on both Linux and Windows, as long as you have the knowledge to code an executable for your platform. It fixes the security hole in the first answer by limiting the possible exploitations.

Basically, instead of relying on bash to run a shell script (which means big security issue), create your own program that opens files with your own extension (let's call it .firefoxlink). Inside the custom .firefoxlink file, it should specify the URL to open in private browsing mode.

Your program would read the file and then start a new firefox instance, just like the shell script does, using the -private-browsing flag. But with the advantage that that is the only thing it can do. No hacker risk.

Then, same steps as before. Assign .firefoxlink files to always open in your custom program, so that everytime you create a link to a .firefoxlink file, it opens the link in a private window.

So what ?

Neither solution is perfect. The first one is something I would never implement on my computers, and the second... well, I just did, but it does require some extra technical knowledge that may be beyond some power users, or simply too much time for such a small problem.


Viewing all articles
Browse latest Browse all 2

Trending Articles