Status
2003-08-29
This patch is against CVS.
About
This patch allows to control another Dillo instance (the
server) by sending it commands. For example, the server can
be requested to open a new URL.
An application can therefore use Dillo as a flexible help
browser. It can launch a single private Dillo instance
used only by itself, and control it to open different
URLs. For example, the application can provide a "Help on
Context" mode for the user: the user clicks on a GUI item
to request help on it, and the application will use the
same Dillo window to show the associated help text. When
finished, it can request the Dillo instance to quit.
Associated with the ability for Dillo to be embedded in
another X-Window window, it can provide an integrated HTML
viewer. The advantage over a library, is that if the HTML
viewer crashes, the application is not affected.
Usage
New Command Line Options
The patch introduces the following new command line options:
- -s, --server NAME: to set the name of the
server to create or to connect to if it is already
running;
- -c, --command COMMAND: to execute the
COMMAND command;
- -H, --help-commands: to display the list of
commands that can be used with the -c,
--command option.
- -r, --reload SECONDS: to set the default auto-reload interval.
Commands
A command passed to the -c, --command option has the
following syntax:
CMD([ARG][ OPTION[=VALUE]]...)
where:
- CMD is the command name;
- ARG is the first command argument;
- [ OPTION[=VALUE]]... is a list of
optional arguments. Each optional argument is
separated with the previous one with a single space.
If the option is of a boolean type, a missing value is
interpreted as if "=yes" was given.
Note: the whole command should be escaped between
double-quotes (") and the ARG must not
contain any space. As in general the ARG is a
URL and as a URL must encode included spaces, this is
not a limitation.
The currently implemented commands are:
- open(URL[ fullwindow[=yes|no]][ newwindow[=yes|no]][ reload=SECONDS][ spamsafe[=yes|no]][ xid=XID]): to open a URL. The
optional arguments allow to specify how and in which
window the URL is to be opened;
- exit(): to stop Dillo;
- fullwindow([yes|no]): to set the default
fullwindow mode;
- reload(SECONDS): to set the default reload
interval;
- xid(XID): to set the default XID X-Window
ID;
- spamsafe([yes|no]): to set the default
SpamSafe mode.
Note: the other command line options are in fact
translated to their -c, --command. The first
URL after all command line options is translated to a
open(URL) command, and the subsequent ones are
translated to open(URL newwindow) commands.
Examples
- dillo -s help URL: open the URL in the server named "help". This is the typical browser command line option to always use the same Dillo instance for every user help request.
- dillo -s watch_log -c "open(URL reload=10 xid=0x8391230)": open the URL in the X-Window XID and reload it every 10 seconds. Can be used to monitor a URL.
- dillo -s external_browser -c "open(URL newwindow)": open the URL in a new window.
Download
2003-08-29
The patch against current CVS is here: dillo-server-mode-CVS-2003-08-29.patch
|