uzbl
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:A web browser that adheres to the unix philosophy.
### INTRODUCTION

Any program can only be really useful if it complies with the Unix
philosophy. Web browsers (and other tools that work with HTML, such as feed
readers) are frequent violators of this principle:

* They build in way too much things into one (complex) program, dramatically
  decreasing the options to do things the way you want.
* They store things in way too fancy formats (XML, RDF, SQLite, etc.) which are
  hard to store under version control, reuse in other scripts, and so on.

The Uzbl project was started as an attempt to resolve this.

### EDITIONS

"Uzbl" is an umbrella project consisting of different flavors. In the future
more things may come, but for now:

#### uzbl-core

Main component meant for integration with other tools and scripts.

* Uses WebKitGtk+ for rendering and network interaction (libsoup). CSS,
  JavaScript, and plugin support come for free.
* Provides interfaces to get data in (commands/configuration) and out (events):
  stdin/stdout/fifo/Unix sockets.
* You see a WebKit view and (optionally) a status bar which gets populated
  externally.
* No built-in means for URL changing, loading/saving of bookmarks, saving
  history, keybindings, downloads, etc.
* Extra functionality: many sample scripts come with it. More are available on
  the [Uzbl wiki](http://www.uzbl.org/wiki/scripts) or you can write them
  yourself.
* Entire configuration/state can be changed at runtime.
* Uzbl keeps it simple, and puts **you** in charge.

#### uzbl-browser

A minimal browser which encompasses a default configuration file, event manager
and a selection of scripts which gives a comparable browsing experience to the
more common browsers.

* Uses a set of scripts (mostly Python) that will fit most people, so things
  work out of the box; yet plenty of room for customization.
* Brings everything you expect: URL changing, history, downloads, form filling,
  link navigation, cookies, event management, etc.
* Advanced, customizable keyboard interface with support for modes, modkeys,
  multichars, variables (keywords) etc. (e.g., you can tweak the interface to
  be Vi-like, Emacs-like or any-other-program-like).
* Adequate default configuration.
* Focus on plaintext storage for your data and configuration files in simple,
  easy-to-parse formats and adherence to the [XDG basedir
  spec](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html).
* Visually, similar to `uzbl-core` except that the status bar contains useful
  information.
* One window per page.

#### uzbl-tabbed

A flavor of `uzbl` built on top of `uzbl-browser` which adds tabbed browsing.

* Spawns one window containing multiple tabs, each tab containing a full
  embedded `uzbl-browser`.
* Ideal as a quick and simple solution to manage multiple `uzbl-browser`
  instances without getting lost.

Throughout the documentation, when referring to `uzbl` we mean `uzbl-core`,
unless otherwise specified.

### CONFIGURATION / CONTROL:

The general idea is that Uzbl by default is very bare bones. You can send it
commands to update settings and perform actions, through various
interfaces. There is a limited, built-in default configuration. It sets a basic
status bar, title format, and network connection settings. By default, there
are *no* keybindings defined at all (default keybindings would be
counterproductive when you try to customize). For examples of the possibilities
what you can do, please see the sample configurations, and [wiki
page](http://www.uzbl.org/wiki/config).

There are several interfaces to interact with Uzbl:

* `uzbl --config `: `` will be read line by line, and the
  commands in it will be executed. Useful to configure Uzbl at startup. If you
  have a file in `$XDG_CONFIG_HOME/uzbl/config` (this expands to
  `~/.config/uzbl/config` on most systems), it will be automatically recognized.
* `stdin`: to write commands into `stdin`, use `--config -` (or `-c -`).
* Interactive: you can enter commands (and bind them to shortcuts, even at
  runtime). By default, the behaviour is modal (vi-like):

  - command mode: every keystroke is interpreted to run commands
  - insert mode: keystrokes are not interpreted so you can enter text into html
    forms

  There is also support for "chained" commands (multiple characters long), and
  keyworded commands. Also you can trigger incremental matching on commands and
  variables after pressing return. See the sample configuration file for more
  information.

  By default, copy and paste works when typing commands:

  - `insert` (paste X cliboard)
  - `shift insert` (paste primary selection buffer)

* FIFO & socket files: If enabled by setting their paths through one of the
  above means, you can have socket and FIFO files available which are very
  useful to control `uzbl` using external programs.

  - The advantage of the FIFO is you can write directly to it, but it's half
    duplex only (`uzbl` cannot send a response to you).
  - The socket is full duplex but a socket-compatible wrapper such as `socat`
    is needed to work with it. For example:

      echo  | socat - unix-connect:

When `uzbl` forks a new instance (e.g., "open in new window") it will use the
same command line arguments (e.g., the same `--config `), except for
`--named`. If you made changes to the configuration at runtime, these are not
passed on to the child.

#### WebKit1 vs. WebKit2

WebKit2 changes many things compared to WebKit1, some of which impact `uzbl`
greatly. This version of `uzbl` only supports WebKit1 while older version tried
to support both at the same time.

For a `uzbl` built on WebKit2 check out the
[next](https://github.com/uzbl/uzbl/tree/next) branch

### COMMAND SYNTAX

`Uzbl` will read commands via standard input, named FIFO pipe (once `fifo_dir`
is set) and Unix socket (once `socket_dir` is set). For convenience, `uzbl` can
also be instructed to read commands from a file on startup by using the
`--config` option. Indeed, the config file is nothing more than a list of
commands with support for comments (using the `#` character).

Each command starts with the name of a command or a `uzbl` variable that expands
to it. A command is terminated by a newline. Empty lines and lines that start
with the hash sign (ignoring leading whitespace) are ignored by the parser.
Command names are always written in lowercase.

A list of commands supported by `uzbl` is given here. Optional arguments are
given in square brackets (`[]`) with literal strings options in lowercase
separated by a pipe (`|`) character. `N` indicates an integer value and other
uppercase values are placeholders describing what the value should be. Required
options are given in angle brackets (`<>`). Arguments on which argument
splitting is not performed are given in curly braces (`{}`). Variable arguments
are indicated with ellipses (`...`). As an example:

    `example1   [URI...]`

means that the command `example` requires its first argument which must either
be a literal `a` or `b`, a second argument which is an integer, and any
remaining arguments are treated as URIs. Another example:

    `example2  {VALUE}`

means that the first argument is split off used as a key and the remaining
string is used verbatim. The command `example2 key many args` would have `key`
as `KEY` and `many args` as `VALUE`.

#### Navigation

* `back [N]`
  - Navigate to the Nth (default: 1) previous URI in the instance history.
* `forward [N]`
  - Navigate to the Nth (default: 1) next URI in the instance history.
* `reload [cached|full]`
  - Reload the current page. If `cached` is given (the default), the cache is
    used. If `full` is given, the cache is ignored.
* `stop`
  - Stop loading the current page. This usually means that no new network
    requests are made, but JavaScript can still run.
* `uri {URI}`
  - Tell `uzbl` to navigate to the given URI.
* `download  [DESTINATION]`
  - Tell WebKit to download a URI.

#### Page

* `load `
  - Load content into the page. Supported subcommands include:
    + `html  `
      * Load content as HTML relative to a URI.
    + `text `
      * Load content as plain text.
    + `error_html   `
      * Load content an error page (which does not appear in the forward/back
        list) at the given URI with the given
* `frame  [NAME]`
  - Operate on frames in the current page. If not name is given, the `_current`
    frame is used. Supported subcommands include:
    + `list` (Unimplemented)
      * Returns a JSON object representing the of frames in the frame.
    + `focus` (Unimplemented)
      * Give focus to the frame.
    + `reload`
      * Reload the frame.
    + `stop`
      * Stop loading the frame.
    + `save` (Unimplemented)
      * Save the content frame.
    + `load` (Unimplemented)
      * Load content into the frame.
    + `get ` (Unimplemented)
      * Get information about a frame.
    + `set  ` (Unimplemented)
      * Set information about a frame.

#### Cookie

* `cookie `
  - Manage cookies in `uzbl`. The subcommands work as follows:
    + `add      `
      * Manually add a cookie.
    + `delete    `
      * Delete a cookie from the cookie jar.
    + `clear all`
      * Delete all cookies.
    + `clear domain [DOMAIN...]`
      * Delete all cookies matching the given domains.

#### Display

* `scroll  `
  - Scroll either the horizontal or vertical scrollbar for the page. The value
    may be one of:
    + `begin`
      * Scrolls to the beginning of the page (either left or up).
    + `end`
      * Scrolls to the end of the page (either right or down).
    + `[-]N`
      * Scrolls N "units" as defined by the scrollbar (seems to be pixels).
    + `[-]N%`
      * Scrolls N% of a single page.
    + `N!`
      * Scrolls to position N on the scrollbar (also in "units").
    + `N%!`
      * Scrolls to position N% on the scrollbar.
* `zoom  [VALUE]`
  - Zoom either in or out by the given amount. When setting, the value is
    required. If no value is given, the variable `zoom_step` is used.
* `hardcopy [REGION]`
  - Print the given region. Supported regions include:
    + `page` (the default)
      * Prints the entire page.
    + `frame [NAME]`
      * Prints the frame with the given name or the current frame if no name is
        given.
* `geometry `
  - Set the size of the `uzbl` window. This is subject to window manager
    policy. If the size is `maximized`, the `uzbl` window will try to maximize
    itself. Otherwise, the size is parsed using the
    `WIDTHxHEIGHT±XOFFSET±YOFFSET` pattern.
* `snapshot    [FLAG...]` (WebKit1 >= 1.9.6)
  - Saves the current page as an image to the given path. Currently supported
    formats include: `png`. Acceptable regions include:
    + `visible`
      * Only includes the regions of the page which are currently visible.

#### Content

* `plugin `
  - Exposes control of plugin-related information. Supported subcommands include:
    + `refresh`
      * Refresh the plugin database.
    + `toggle [NAME...]`
      * Toggle whether the given plugins are enabled (or all if none are given).
* `remove_all_db`
  - Remove all web databases.
* `spell ` (WebKit1 >= 1.5.1)
  - Use WebKit's spell check logic. Supported subcommands include:
    + `ignore [WORD...]`
      * Add the given words to the list of words to ignore.
    + `learn [WORD...]`
      * Teaches that the given words are spelled correctly.
    + `autocorrect `
      * Returns the word as autocorrected by the checker.
    + `guesses `
      * Returns the guesses for the word given by the checker as a JSON list.
* `favicon `
  - Controls the favicon database. Supported subcommands include:
    + `clear`
      * Clears all cached favicons.
    + `uri `
      * Returns the URI of the favicon for the given URI.
    + `save  ` (Unimplemented)
      * Saves the favicon for the given URI to a path.
* `css `
  - Controls CSS settings in web pages. Supported subcommands include:
    + `add `
      * Adds a CSS file to pages when loaded. Despite the name, subsequent calls
        replace any previous invocation. Meaning that only one single stylesheet
        may be activated with this command.
    + `clear`
      Clears all user-supplied stylesheets.
* `scheme  {COMMAND}`
  - Registers a custom scheme handler for `uzbl`. The handler should accept a
    single argument for the URI to load and return HTML. When run, the output
    is interpreted as content at the URL with a leading line with the MIME
    type.
* `menu `
  - Controls the context menu shown in `uzbl`. Supported subcommands include:
    + `add   `
      * Appends a new entry to the menu with the given name and runs the given
        command when used.
    + `add_separator  `
      * Appends a new separator to the menu with the given name.
    + `remove `
      * Remove items which have the given name.
    + `query `
      * Returns the command for the item with the given name.
    + `list`
      * Returns the names of items in the menu as a JSON list.
    The list of supported objects is:
    + `document`
    + `link`
    + `image`
    + `media`

#### Search

* `search `
  - Controls WebKit's search mechanisms. Supported subcommands include:
    + `option `
      * Manage options for searching. Options may be prefixed with `+` to set,
        `-` to unset, `!` to toggle, and `~` to reset to its default. The
        default options have `wrap` enabled. Recognized options include:
        - `wrap`
          + If set, searches will wrap around when the start or end of the
            document is reached.
        - `case_insensitive`
          + If set, searches are case-insensitive.
    + `options`
      * Returns the current options as a JSON list.
    + `clear`
      * Turn off searching. The current options and search string are
        preserved.
    + `reset`
      * Turn off searching, setting the options back to the default and
        forgetting the search string.
    + `find {STRING}`
      * Search forward in the document for the string. If no string is given,
        the previous search string is used.
    + `rfind {STRING}`
      * As `find`, but searches backwards in the document.
    + `next`
      * Jumps to the next instance of the search string in the document in the
        same direction as the last `find` or `rfind` command.
    + `prev`
      * As `next`, but searches in the opposite direction from the last `find`
        or `rfind` command.
* `security