Browser Detection on UNIX

OpenOffice.org

Document - ID	Specification Owner	Last Change	Status
	Oliver Braun	04/20/04	Final
Conforms to	
Applies to	OpenOffice.org
Task ID(s)	i20365, i14310
Category	Enhancement

Abstract

OpenOffice.org 2.0 will have functionality build in to identify the users preferred web-browser from the desktop environment one is running. As a consequence, the now obsolete and UNIX only UI in OpenOffice.org 1.x for selecting a browser applications will get removed.

i-Team Members (The specification owner is part of the i-Team)

	Name	E-mail Address
User Experience	Christian Jansen (CJ) Falko Tesch (FT)	cj@openoffice.org ft@openoffice.org
Development	Oliver Braun (OBR)	obr@openoffice.org
Quality Assurance	Jörg Skottke (JSK) Andreas Treumann (ATR) Ulf Ströhler (US)	jsk@openoffice.org atr@openoffice.org us@openoffice.org
Documentation	Uwe Fischer (UFI)	ufi@openoffice.org

Approved for Implementation

	Approved by	Date
User Experience	Christian Jansen (CJ)	03/25/04
Development	Oliver Braun (OBR)	03/29/04
Quality Assurance	Andreas Treumann (ATR)	03/23/04
Documentation	Uwe Fischer (UFI)	03/22/04
String Review	Elizabeth Matthis	04/08/04

Document Change History

Rev. Level	Change	Initials	Date
1.0	Initial submit	obr	02/27/04
1.1	Incorporated early feedback	obr	03/08/04
1.2	Small additions and corrections	obr	03/09/04
1.3	Added link to "Send Docu as E-Mail" specification	obr	03/22/04
1.4	Incorporated error message changes from CJ and added approvals received by email	obr	03/29/04
1.5	String review	em	04/08/04
1.6	Changed status to final	obr	04/20/04

Browser Detection on UNIX

Contents

Glossary	1

1	Motivation	1

2	User Scenarios	1

3	Goals	1

4	Requirements and Dependencies	1

4.1	Requirements	1

4.2	Technical Dependencies	2

5	Competitive Analyses	2

6	Detailed Specification	2

6.1	G11n	4

6.2	Error Conditions	4

6.2.1	No Web-Browser specified / found	4

6.2.2	Specified Web-Browser does not start	4

6.2.3	Web-Browser can not load the document specified by the URI	4

7	Future Tasks	4

8	Notes	5

9	References	5

Glossary

Term	Description
URI	Uniform Resource Identifier (http://www.w3.org/Addressing/), short strings that identify resources in the web (also known as “URL”).
GUI	Graphical User Interface
CDE	Common Desktop Environment, the former standard desktop of Solaris.
GNOME	GNU Network Object Model Environment (http://www.gnome.org/about/), the new standard desktop for Solaris and JDS.
KDE	K Desktop Environment (http://www.kde.org/whatiskde/), an alternative desktop for Unix, mainly supported by Novell/SuSE.

Motivation

Simplify the task of configuring a browser in OpenOffice.org on Unix for the user along with fixing some problems caused by the fact that OpenOffice.org ships with a number of shared libraries from the Mozilla project.

User Scenarios

OpenOffice.org documents can contain hyperlinks (URI) to external documents, which under certain circumstances described in [1] and [2] shall be opened in a web browser or some other suitable application.

The first time a user exercises this feature in OpenOffice.org 1.x on Unix, one is presented an error message and pointed to a rather cryptic configuration tab-page. Doing the same on Windows works out-of-the-box.

To ease the migration path as well as to increase the usability experience of OpenOffice.org on Unix systems the task of identifying a suitable web-browser should be automated as much as possible.

Goals

Use the desktop's default URI handler where possible (Gnome, KDE, CDE).

In desktop environments which do not have the notion of URI handlers, find reasonable fallbacks (e.g. in /etc/mailcap) and simplify the task of configuring a browser in OpenOffice.org by reducing the number of configuration entries to one.

Opening a file in Mozilla shall work even if Mozilla is already running or uses conflicting versions of libraries that get shipped with OpenOffice.org as well.

Requirements and Dependencies

Requirements

At least one internet browser which accepts URI via command line is required for this feature to work.

Technical Dependencies

OpenOffice.org must be able to detect the desktop environment it is running in and has to expose this information in a way it can be re-used at various places (without copying the code).

Competitive Analyses

MS Windows ® and Mac OS X ® do have a default browser setting (although it can not be changed in all MS Windows ® versions). Therefor a fallback setting to configure a browser in OpenOffice.org is not necessary on these platforms.

In GNOME a desktop wide browser setting is available since version 2 and can be changed by running Applications – Desktop Preferences – [Advanced] – Preferred Applications. Also CDE does have such a setting, even though the user has to copy the file /usr/dt/appconfig/types/C/user-prefs.dt into $HOME/.dt/types and to manually edit the WebBrowser section.

Detailed Specification

Whenever the user chooses to open a URI externally, OpenOffice.org 2.0 will try to pass URI to the users desktop environment to get opened in his/her preferred browser/application. If the desktop environment is unknown or any error occurred passing the URI to the desktop environment, OpenOffice.org 2.0 will evaluate BROWSER [3] environment variable for http, https, ftp and file URIs and MAILER for mailto URIs. If also these environment variables are not set, OpenOffice.org 2.0 will try to locate any browser (of a fixed list of executable names) in the users PATH. If even this fails, the user is presented the error message described in 6.2.1.

The GUI to specify applications for the different URI types (http, https, ftp, mailto) and the file manager (responsible for file URIs) in Tools-Options-%PRODUCTNAME-External Programs will get removed. The following screen-shots illustrate how the tab page looked like in StarOffice 7 (OpenOffice.org 1.x) and how it will look like in StarOffice 8 (OpenOffice.org 2.0).

Illustration 1To-be-depreciated “External Programs” tab page in StarOffice 7

Illustration 2 New, reduced “External Programs” tab page in StarOffice 8

The Help content for this tab page needs to be updated accordingly.

The correctness of the remaining strings on the External-Programs tab-page will be revised in the “Send Document as E-Mail” [4].

For backward compatibility reasons (migration), the OpenOffice.org 1.x configuration settings for URI handlers, which are:

org.openoffice.Office.Common/ExternalApps/http
org.openoffice.Office.Common/ExternalApps/https
org.openoffice.Office.Common/ExternalApps/ftp
org.openoffice.Office.Common/ExternalApps/file
org.openoffice.Office.Common/ExternalApps/mailto

will be the preferred fallback if the URI could not be passed to the desktop environment, so the algorithm for opening URI s externally is

pass the URI to desktop environment. If this fails or the desktop environment is not supported

check whether BROWSER/MAILER environment variable is set. If so, pass the URI to it's value. If not

pass the URI to the corresponding handler defined in the configuration. If there is no handler specified

try to find any browser on the system to pass the URI to.

The following desktop environments will be supported:

Deskop Environment	Browser invoking mechanism
GNOME	call gnome_url_show() from libgnome[-2].so
KDE	run `kfmclient openURL $uri` or `kmailservice $uri`
CDE	run `echo $uri > /tmp/$$.url; dtaction Browse /tmp/$$.url; rm -f /tmp/$$.url` or `echo $uri > /tmp/$$.mailto; dtaction Open /tmp/$$.mailto; rm -f /tmp/$$.mailto'
Mac OS X	run `open` command line tool.
others / fallback	evaluate $BROWSER environment variable as described in [3]

For consistent behavior, the registration dialog will use the same mechanisms to find a suitable browser on the system.

Tab Order

the GUI for selecting a browser is going to be removed.

Key Board Shortcuts

the GUI for selecting a browser is going to be removed.

G11n

none.

Error Conditions

No Web-Browser specified / found

String list

Item	English	German	Comments
Warning	%PRODUCTNAME could not find a web browser on your system. Please check your Desktop Preferences or install a web browser (for example, Mozilla) in the default location requested during the browser installation.	%PRODUCTNAME konnte auf Ihrem Rechner keinen Web-Browser finden. Bitte überprüfen Sie Ihre Arbeitsplatz-Einstellungen, oder installieren Sie einen Web-Browser (z.B. Mozilla) an die von dem Web-Browser vorgeschriebene Stelle.	

Specified Web-Browser does not start

Since it is not desirable that OpenOffice.org waits for the web browser to finish its startup, the engineering effort for showing a warning in this rather unlikely case is considered too high to implement. However this is subject to change if the assumption about the likeliness of this error condition turns out to be wrong.

Web-Browser can not load the document specified by the URI

In this case the web browser is expected to display an appropriate error message.

Future Tasks

The browser detecting mechanisms may fail if OpenOffice.org does not run on the same machine as the rest of the users desktop. To fix this, there would have to be a communication between OpenOffice.org and the desktop through some X protocol extension.

Notes

With KDE 3.1, specifying a different mail client than KMail does only work in english locales.

References

[1] New HYP(erlink) and SEL(ection) Behavior”: chapter 6.1.5 in:
http://specs.openoffice.org/appwide/xforms/GUI_spec_part1.sxw

[2] ToDo: Reference to the spec which URIs to open internally / externally.

[3] The BROWSER project (http://www.catb.org/~esr/BROWSER/index.html).

[4] Send Document as E-Mail:
http://specs.openoffice.org/appwide/desktop_integration/send_as_email.sxw

Browser Detection on UNIX

Page 5

http://specs.openoffice.org/appwide/desktop_integration/unix_browser_detection.sxw

Browser Detection on UNIX

Oliver Braun

2004-02-10T10:18:54