How to make Opera behave like a Site-Specific Browser
Friday, December 21, 2007 2:30:50 PM
I've been an avid Opera user since...6.x, I think, so I didn't really want to have to use Mozilla for an SSB. I was thinking, with Opera's immense customizability, there just has to be a solution without getting a separate app. I think I got pretty close.
First, I'd like to emphasize that I have not tried Mozilla Prism at all, I just read some news posts about it and thought: “Hey, that could be useful, I bet Opera can do it.”
So what does an SSB do really? (At least how I understand it.) It attempts to integrate an operating system-, location-, and desktop environment-independent web application into a desktop environment. Since web applications are supposed to be self-contained (all functionality comes from the site itself), an easy step to making them look like normal desktop applications is to strip the browser of its controls.
Really, that's all we're doing here.
The command line options we'll use to achieve this are the following:
- --nomenu — these are self-explanatory. UPDATE: You might want to skip this option and uncheck opera:config#UserPrefs|ShowMenu instead, so the menu will still be invisible, but if you want to change some settings you can always press the keyboard shortcuts for the menus (i.e. Alt+T for the Tools menu in the english UI).
- UPDATE: --nomail — to prevent the mail subsystem from loading. Maybe this saves us some RAM?
- --nosession — to disable sessions. Not sure this is needed since we're going to give an URL for Opera to load directly.
- --pd $HOME/.operassb — this defines a separate profile directory to be used instead of the default. We need this so that our settings to get an SSB-like setup do not overwrite our regular browsing settings. $HOME/.operassb points to the (hidden) directory .operassb in your home directory on Unix-like operating systems. For windows, you could use the %APPDATA% environment variable, or an absolute path of your choice.
- --geometry 800x650+250+40 — this sets the window's dimensions to 800px×650px, with an X offset of 250px and a Y offset of 40px. This works fine for me for Gmail, but of course this depends on the web app of your choice, your font sizes etc., so this should be set for each web app you want to launch. UPDATE: It seems that for subsequent instances of the same profile, different --geometry parameters are ignored, but the originally specified offsets are relative to the previous instance's position. The former might be a bug in 9.5, stay tuned until I find out. UPDATE: Filed a bug, hopefully fixed soon! Thanks go to csant @ OperaNet #weekly. UPDATE: The bug is fixed as of 9.5 UNIX build 1754! Thank you!
- --notrayicon — disables the tray icon. Me no like.
- UPDATE: --newwindow — to make the supplied URL open in a new window instead of an invisible tab if there's already an instance running in the same profile.
And thus, our final command looks something like this for Gmail on my computer running Ubuntu:
opera --nopanel --nomenu --nomail --nosession --pd ./.operassb --geometry 800x650+250+40 --notrayicon --newwindow http://gmail.com/
Additionally, you can set opera:config#UserPrefs|Title to %t so that only the current page's title is displayed in the title bar, instead of the default Title - Opera.
Thanks for reading, and don't forget to comment!
UPDATE: Be sure to check out zomg's solution too!
PS: The Gmail icon I used for the launcher on my desktop is from Monolistic's Google icon set.