How to make Opera behave like a Site-Specific Browser
Friday, December 21, 2007 2:30:50 PM
This post was inspired by the recent hype about Mozilla's Prism, and Site-Specific Browsers in general. For those not in the know: a Site-Specific Browser is a browser (or a browser window as we'll see later on) thats only purpose is to display a single website to help integrate it into the desktop environment. This is useful for web applications (which seem to be all the rage now); sites that serve a single function, like a mail or calendar application, a browser-based RSS aggregator etc.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:
- --nopanel
- --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.









Khaled KhalilKhaled-Khalil # Wednesday, January 14, 2009 8:29:53 AM
the most important for me is that `--pd` option let opera to run a new instance, not depending on the running process, formerly (before i knew it) i used to run one installed and another extracted from archive for inspecting purpose, now life is easier, i tried prism, and actually hated it even more than firefox itself, but i may use Opera as SSB with opera_gmail, opera_facebook, opera_myopera in the future. i don't like SSB, but i see some strong attraction to use it with opera.
the only thing missing is the icon, when you have multiple unrelated windows, you may like to assign a special icon for each window (application), that could be don in windows (opera:config#UserPrefs|ApplicationIcon) but unfortunately not here
jegHegy # Friday, January 16, 2009 8:25:18 AM
Anyway, I didn't expect a comment on this after two years. I'm glad you found it useful.
Khaled KhalilKhaled-Khalil # Saturday, March 21, 2009 12:54:02 PM
i gave firefox many trials, but it is for me, uh, another thing than browser, sorry to say that.
i found a way to set the icon, try this session.
the trick is that the session has only one entry used for both the window and its only tab, the "parent id" is set to 0.
unfortunately if it is opened only from this session (or renamed "autosave.win") opera will open an empty window beside it, that needs more workarounds.
ZodiusAleksOD # Saturday, January 30, 2010 8:15:57 PM
Anyway, here is my approach to using Opera as an SSB: http://my.opera.com/AleksOD/blog/2009/12/21/webapps-powered-by-opera-web-browser
Unregistered user # Tuesday, April 6, 2010 3:18:03 PM