On passing a url to an application
Most operating systems allow you to run applications with commandline parameters:
mozilla http://www.mozilla.org
Windows offers an alternative method of passing information/commands/requests called DDE (Dynamic
Data Exchange):
Application:NSShell
Topic:WWW_OpenURL
content:http://www.mozilla.org
MacOS offers AppleScript:
tell mozilla
OpenURL http://www.mozilla.org
end tell
Netscape for X11 introduced x-remote which uses x properties to send messages
netscape -remote 'openURL(http://www.mozilla.org)'
BeOS has BMessages, but BeZilla doesn't support them ...
Ok, so each platform has some way to allow an external program to tell a browser to open a url.
Why is this interesting?
Well, at some point there were two ways that a url could be handled,
opening it i the same window, or opening it in a new window.
Advanced users think that the x-remote and commandline flags are there so that they as users can
control how mozilla behaves, but is that really what happens?
The DDE version is obviously used by Applications, not users.
The commandline and X11 versions will frequently be used by programs on behalf of users.
Now suppose that you're using a computer running windows 98 which has 3 mozilla profiles (you share
the computer with your significant other and a roommate). Suppose that you have 20 programs that
might want to help you open urls:
- Acrobat
- AIM
- DVD Player (DVD Content Links to websites)
- Eudora
- Excel/QuatroPro
- Explorer
- FrontPage/FrontPad
- HotLine
- ICQ
- kazaa
- mIRC
- Macromedia Shockwave/Director/Flash (CD Content)
- Outlook(Express)
- PowerPoint/Presentations
- QuickTime
- RealPlayer
- SecureCRT
- WinAmp
- Word(Perfect)
- WMP
- shareware about boxes
Oh, and don't forget the internal non browser apps (mail, irc, jsdebugger)
Today, many of those programs probably have their own setting which controls which browser they run
and how they run it. Perhaps some programs don't let you configure it, and perhaps some actually
honor a system preference. But then the fun is which system preference do they honor,
there are so many to choose:
- default browser
- registered http: handler
- registered .html handler
- registered .htm handler
- registered .url handler
Now let's get back to how you use your computer...
- You might be one of those people who likes to drag urls from apps to specific windows (we can call
this the 'controller' type).
- You could be the kind of person who doesn't want to have more than one browser window (we can call
this the 'single window' type).
- You might be the kind of person who doesn't trust your browser not to crash or lose form data,
which means that you'd configure IE to browse in new processes, that you'd want links to open new
windows, and that you really should be using windows NT (we can call this the 'new process' type).
- You might be a more normal windows 98 user who doesn't want to lose your place in your current
document (we can call this the 'new window' type) whether or not you know that Mozilla has a
tendency to lose form data and crash in addition to forgetting where you were on a page or in your
browsing session history.
- You might be a power user or just really creative such that you really want different external
applications to do different things when you click on a link (I will call you the 'arbitrary' type).
- It is my belief that the Firebird team doesn't think this last kind of user is typical. I'm not a
member of that team, but this is also my opinion. Whether I'd actually fall into this category is
another matter. The proposal I will suggest will not ignore this type of user entirely, but is not
designed for this type of user either.
There's this one other edge case, which is one of the reasons that the different options exist:
- An external application wants to use a single mozilla window somewhat interactively.
What does that mean? well suppose that the application is an HTML Editor and it has a preview
function which is using mozilla. In this case it makes sense for it to reuse a window even if you
would normally not want to reuse a window. But even in this case, you might want to be able to
decide whether you really want to reuse the window.
Read On...