Opera Private mode
Monday, 15. December 2008, 15:34:53
While Opera doesn't have a built in private mode (yet?), it is fairly easy to make it behave in a very private way. You have probably noticed the -private command line option listed in opera -help and tried it to see what it does. We had an implementation of private mode internally some time ago which we unfortunately didn't finish, and we forgot to remove this option when we decided not to release it.
But fear not, it is still possible to make Opera behave privately! All you have to do is use a simple wrapper script that sets up a protected and random personal directory (the place opera stores all its user data). I know, "script". It may sound daunting, but it really isn't, as long as you know how to save a file as root, aka "super user".

Running Opera in Private mode is very nice if your PC is borrowed by people you know - simply make them use the Opera Private mode browser, and they don't have to worry about you seeing anything they didn't want you to see.
What it does is quite simple:
Thanks to Arve for the initial implementation.
To set it up, fetch the opera private mode wrapper and follow the instructions.
I haven't investigated how this can be done on Windows and Mac, but it should be possible there too. (Please tell me!)
But fear not, it is still possible to make Opera behave privately! All you have to do is use a simple wrapper script that sets up a protected and random personal directory (the place opera stores all its user data). I know, "script". It may sound daunting, but it really isn't, as long as you know how to save a file as root, aka "super user".

Running Opera in Private mode is very nice if your PC is borrowed by people you know - simply make them use the Opera Private mode browser, and they don't have to worry about you seeing anything they didn't want you to see.
What it does is quite simple:
- Define a temporary random name folder to store the data in.
- Set the umask to 0077, which means that all the files will be unreadable to anyone but the one who started Opera
- Insert settings in the opera6.ini file, to prevent you from having to see the licence dialog and the KDE keyboard shortcuts message every time, in addition to setting the Opera title to "Opera Private mode"
- When you exit, the folder will be removed.
Thanks to Arve for the initial implementation.
To set it up, fetch the opera private mode wrapper and follow the instructions.
I haven't investigated how this can be done on Windows and Mac, but it should be possible there too. (Please tell me!)















FataL # 16. December 2008, 18:14
edvakf # 17. December 2008, 20:46
===========================
#!/bin/bash
umask 0077
export dir="$HOME/Library/Preferences/Opera Preferences private"
mkdir -p "$dir"
echo -e "[User prefs]\nTitle=Opera Private mode" > "$dir/Opera 9 Preferences"
/Applications/Opera.app/Contents/MacOS/Opera -personaldir private 2> /dev/null
rm -r "$dir"
rm -r "$HOME/Library/Caches/Opera private/"
rm -r "$HOME/Library/Application Support/Opera private/"
===========================
Save the above as opera-private.sh and do
===========================
chmod 700
===========================
Put it into a folder with a setting file and icons, rename the folder to .app
Then there you go. Really simple OperaPrivateMode.app for Mac OS X.
I created a package below.
http://edvakf.googlepages.com/OperaPrivateMode.app.zip
godjonez # 17. December 2008, 22:45
Make sure to edit the start line with correct Opera path if you have it installed in another path.
Save the file with .cmd or .bat extension (both work) and put it to an accessible location.
Edited 18th Dec: The folder structure was retained in temp folder, changed to use rmdir to clear it.
thetomster # 20. December 2008, 14:46
godjonez # 20. December 2008, 18:19
basseman # 11. June 2009, 23:39
however with Opera 10 Beta, it doesn't work
I modified the script to make it easy to switch between 9.X install and 10 Beta.
as you can see I made the filename operaprefs.ini and modified the install path. But still when I load my opera 10 it still use the default operaprefs
@echo off
set operadir=%TEMP%\%RANDOM%
rem set operadir=c:\temp\test
rem set filename=opera6
set filename=operaprefs
mkdir %operadir%
echo [User prefs] > %operadir%\%filename%.ini
echo Title=Opera Private mode >> %operadir%\%filename%.ini
echo Opera Directory=%operadir%\ >> %operadir%\%filename%.ini
echo Opera Local Directory=%operadir%\ >> %operadir%\%filename%.ini
echo Operator Cache Directory4=%operadir%\opcache\ >> %operadir%\%filename%.ini
echo [State] >> %operadir%\%filename%.ini
echo Accept Licence=1 >> %operadir%\%filename%.ini
rem start "Opera Private mode" /wait "C:\Program Files\Opera\opera.exe" /Settings %operadir%\%filename%.ini
start "Opera Private mode" /wait "C:\Program Files\Opera 10 Beta\opera.exe" /Settings %operadir%\%filename%.ini
rmdir /s /q %operadir%
godjonez # 12. June 2009, 15:17
fearphage # 3. July 2009, 09:35
Originally posted by godjonez:
Resolved in the latest build.I have added to godjonez's script to accommodate automatically for 32 and 64 bit windows:
I also set a few additional options and things which you can freely remove. A big difference with mine is it does not wait for opera to close. It cleans up before it is run instead of after.
godjonez # 4. July 2009, 19:09
The way yours checks for 32/64 bit would be fine for some setups, but since Opera can be installed on other folder than the default one (and Opera 10 installs in different folder anyway), it's still not a perfect solution. That's the reason I left the exe path very simple on my script, so that the user can edit it to point to the correct folder.
Of course, if there was a way to get the Opera's location from registry, it would be much better. Too bad there is not a built-in way to do that with Windows command scripts, but it is possible if used together with my regshx program. (see my blog for more info about that)
DanielHendrycks # 5. September 2009, 00:13