PDQ DocumentationThis is not complete documentation for BrowseX . What is described are some of the novel features of BrowseX . Namely Tcl scripts embedded in web pages, the macro processor and external program preprocessing. For examples of embedded Tcl programs, see Examples off the Download section. See here for the Expand documentation.
Tcl Embeds/ScriptsBrowseX supports running Tcl code in a sandbox-like environment called Safe-Tcl. By default, Safe-Tcl disables all commands which could be potentially harmful. PDQ relaxes this security slightly to allow menus and toplevels. Menus enable mouse-grabs which Safe-Tcl views as a potential exposure due to the possibility of a denial of service attach (mouse grabbed but not let go). The risk of this should be minimal, but in any case it can be disbled in the preferences if concerned.
There are two ways of embedding client side Tcl into web pages.
EmbedsAn embed can either inline the Tcl code between the embed and /embed or it can use a src= argument to fetch the code remotely. The first method is probably preferable since it results in faster time-to-load performance, but any sorrounding HTML may not render correctly.
ScriptsEmbed is typically used to run a Tk program, that is, a gui based application. Scripts on the other hand, are used to work in conjunction with or to generate HTML. The script model is therefore a bit more complicated. There are two distinct phases to Scripted pages. In the first, Tcl script commands are executed and any puts output is rendered as HTML. When the full page has been completely parsed PDQ will attempt to run the local proc After, if defined. The after proc can setup things like bindings on input fields for form validation. See form.html and use view source, for an example.
External Program PreprocessorLets say the only thing that stands in between you and web happiness is doubleclick ads inside web pages. What you may want is a way to disable just those images. External program preprocessing can handle this nicely.
#!/bin/sh if [ x"$2" = "xtext/html" ]; then exec sed 's/doubleclick.net/my.domain/' fiThe essential workings are, the program is passed 2 arguments: the url and the document type. Only text/* is handled. The page information is read from stdin and must be written back out to stdout. Unix pipelines are ideal for this kind of task.
Copyright © 1999-2001 Browsex Systems Inc http://BrowseX.com