about summary refs log tree commit diff stats
path: root/302stack_allocate.subx
Commit message (Collapse)AuthorAgeFilesLines
* 6760Kartik Agaram2020-09-081-7/+6
| | | | | | | | Fix a couple of subtle bugs. - the VM was conditionally reading from the instruction stream, so that other bugs got masked by decoding errors. - push-n-bytes was clobbering eax.
* 6612 - reorganize layersKartik Agaram2020-07-051-0/+62
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 302stack_allocate.subx</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="none">
<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
<meta name="colorscheme" content="minimal-light">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #c6c6c6; }
body { font-size:12pt; font-family: monospace; color: #000000; background-color: #c6c6c6; }
a { color:inherit; }
* { font-size:12pt; font-size: 1em; }
.subxComment { color: #005faf; }
.LineNr { }
.SpecialChar { color: #d70000; }
.CommentedCode { color: #8a8a8a; }
.subxFunction { color: #af5f00; text-decoration: underline; }
.Constant { color: #008787; }
-->
</style>

<script type='text/javascript'>
<!--

/* function to open any folds containing a jumped-to line before jumping to it */
function JumpToLine()
{
  var lineNum;
  lineNum = window.location.hash;
  lineNum = lineNum.substr(1); /* strip off '#' */

  if (lineNum.indexOf('L') == -1) {
    lineNum = 'L'+lineNum;
  }
  var lineElem = document.getElementById(lineNum);
  /* Always jump to new location even if the line was hidden inside a fold, or
   * we corrected the raw number to a line ID.
   */
  if (lineElem) {
    lineElem.scrollIntoView(true);
  }
  return true;
}
if ('onhashchange' in window) {
  window.onhashchange = JumpToLine;
}

-->
</script>
</head>
<body onload='JumpToLine();'>
<a href='https://github.com/akkartik/mu/blob/master/302stack_allocate.subx'>https://github.com/akkartik/mu/blob/master/302stack_allocate.subx</a>
<pre id='vimCodeElement'>
<span id="L1" class="LineNr"> 1 </span><span class="subxComment"># A function which pushes n zeros on the stack.</span>
<span id="L2" class="LineNr"> 2 </span><span class="subxComment"># Not really useful to call manually.</span>
<span id="L3" class="LineNr"> 3 </span><span class="subxComment"># The Mu compiler uses it when defining arrays on the stack.</span>
<span id="L4" class="LineNr"> 4 </span>
<span id="L5" class="LineNr"> 5 </span>== code
<span id="L6" class="LineNr"> 6 </span>
<span id="L7" class="LineNr"> 7 </span><span class="CommentedCode">#? Entry:</span>
<span id="L8" class="LineNr"> 8 </span><span class="CommentedCode">#?     # . prologue</span>
<span id="L9" class="LineNr"> 9 </span><span class="CommentedCode">#?     89/&lt;- %ebp 4/r32/esp</span>
<span id="L10" class="LineNr">10 </span><span class="CommentedCode">#?     #</span>
<span id="L11" class="LineNr">11 </span><span class="CommentedCode">#?     68/push 0xfcfdfeff/imm32</span>
<span id="L12" class="LineNr">12 </span><span class="CommentedCode">#?     b8/copy-to-eax 0x34353637/imm32</span>
<span id="L13" class="LineNr">13 </span><span class="CommentedCode">#? $dump-stack0:</span>
<span id="L14" class="LineNr">14 </span><span class="CommentedCode">#?     (push-n-zero-bytes 4)</span>
<span id="L15" class="LineNr">15 </span><span class="CommentedCode">#?     68/push 0x20/imm32</span>
<span id="L16" class="LineNr">16 </span><span class="CommentedCode">#? $dump-stack9:</span>
<span id="L17" class="LineNr">17 </span><span class="CommentedCode">#?     b8/copy-to-eax 1/imm32/exit</span>
<span id="L18" class="LineNr">18 </span><span class="CommentedCode">#?     cd/syscall 0x80/imm8</span>
<span id="L19" class="LineNr">19 </span>
<span id="L20" class="LineNr">20 </span><span class="subxComment"># This is not a regular function, so it won't be idiomatic.</span>
<span id="L21" class="LineNr">21 </span><span class="subxComment"># Registers must be properly restored.</span>
<span id="L22" class="LineNr">22 </span><span class="subxComment"># Registers can be spilled, but that modifies the stack and needs to be</span>
<span id="L23" class="LineNr">23 </span><span class="subxComment"># cleaned up.</span>
<span id="L24" class="LineNr">24 </span>
<span id="L25" class="LineNr">25 </span><span class="subxComment"># Overhead:</span>
<span id="L26" class="LineNr">26 </span><span class="subxComment">#   62 + n*6 instructions to push n bytes.</span>
<span id="L27" class="LineNr">27 </span><span class="subxComment"># If we just emitted code to push n zeroes, it would be:</span>
<span id="L28" class="LineNr">28 </span><span class="subxComment">#   5 bytes for 4 zero bytes, so 1.25 bytes per zero. And that's not even</span>
<span id="L29" class="LineNr">29 </span><span class="subxComment">#   instructions.</span>
<span id="L30" class="LineNr">30 </span><span class="subxComment"># But on the other hand it would destroy the instruction cache, where this</span>
<span id="L31" class="LineNr">31 </span><span class="subxComment"># approach requires 15 instructions, fixed.</span>
<span id="L32" class="LineNr">32 </span>
<span id="L33" class="LineNr">33 </span><span class="subxComment"># n must be positive</span>
<span id="L34" class="LineNr">34 </span><span class="subxFunction">push-n-zero-bytes</span>:  <span class="subxComment"># n: int</span>
<span id="L35" class="LineNr">35 </span><span class="Constant">$push-n-zero-bytes:prologue</span>:
<span id="L36" class="LineNr">36 </span>    89/&lt;- *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L56'>Push-n-zero-bytes-ebp</a></span> 5/r32/ebp  <span class="subxComment"># spill ebp without affecting stack</span>
<span id="L37" class="LineNr">37 </span>    89/&lt;- %ebp 4/r32/esp
<span id="L38" class="LineNr">38 </span><span class="Constant">$push-n-zero-bytes:copy-ra</span>:
<span id="L39" class="LineNr">39 </span>    <span class="subxComment"># -- esp = ebp</span>
<span id="L40" class="LineNr">40 </span>    89/&lt;- *<span class="SpecialChar"><a hrefpre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
.\" Copyright (c) 2010, 2011, 2012 Marco Peereboom <marco@peereboom.us>
.\" Copyright (c) 2011 Jason McIntyre <jmc@openbsd.org>
.\" Copyright (c) 2012 Josh Rickmar <jrick@devio.us>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: July 25 2012 $
.Dt XOMBRERO 1
.Os
.Sh NAME
.Nm xombrero
.Nd lightweight web browser
.Sh SYNOPSIS
.Nm xombrero
.Bk -words
.Op Fl nSTtV
.Op Fl f Ar file
.Op Fl s Ar session_name
.Op Ar url ...
.Ek
.Sh DESCRIPTION
.Nm
is a minimalistic web browser that tries to stay out of the way so that
valuable screen real estate can be used for much more important stuff.
It has sane defaults and does not require one to learn a language to do any
configuration.
It was written by hackers for hackers
and it strives to be small, compact, and fast.
.Pp
.Nm
is very simple in its use.
Most actions are initiated via key or mouse bindings.
Key bindings are based on those of the
.Xr vi 1
text editor,
giving web browsing a similar feel to navigating a text document.
The
.Sx KEY BINDINGS
section below documents the various defaults and possible customizations.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl f Ar file
Specify an alternative configuration file.
.It Fl n
Open a new tab in a running
.Nm
for each specified URL.
This option requires
.Cm enable_socket
to be enabled.
.It Fl e Ar command
Execute arbitrary command (see the
.Sx COMMAND MODE
section below) in a running
.Nm
instance. This option requires
.Cm enable_socket
to be enabled. Example run: xombrero -e "tabnew openbsd.org"; xombrero -e
tabclose; xombrero -e wq.
.It Fl S
Disable the toolbar.
.It Fl s Ar session_name
Open session that was saved with ":session save" command.
.It Fl T
Disable visualization of tabs.
.It Fl t
Disable tabs.
.It Fl V
Display version and exit.
.El
.Sh FAST STARTUP
The following notation is used throughout this page:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm C-
Control
.It Cm S-
Shift
.It Cm M1-
Meta 1 (sometimes marked Alt)
.It Cm M2-
Meta 2
.It Cm M3-
Meta 3
.It Cm M4-
Meta 4 (sometimes marked Windows)
.It Cm M5-
Meta 2
.It Cm MB1
Mouse button 1
.El
.Pp
To browse to a specific address,
either use the mouse to click on the address bar
or press
.Cm F6
to shift the keyboard focus to the address bar.
The address is then entered manually.
.Pp
The mouse can be used to navigate the page in the traditional manner,
or the keyboard can be used instead.
For example,
.Cm PageUp
and
.Cm PageDown
will scroll up and down the page.
.Pp
To follow a link,
either click on it or use the
.Cm f
key and have
.Nm
assign numbers to each link on the page;
entering that number on the keyboard will prompt
.Nm
to follow the link.
.Sh KEY BINDINGS
.Nm
provides many actions accessed via key or mouse bindings.
Most can be reprogrammed using a
.Cm keybinding
entry in the configuration file.
Each keyboard shortcut requires exactly one entry in the configuration file.
A shortcut can have multiple entries in the configuration file.
The format of the keybinding entry is as follows:
.Pp
.D1 keybinding = (:)action,(!)keystroke(s)
.Pp
For example, "keybinding = tabnew,C-t" where
.Cm tabnew
is the action and
.Cm C-t
are
the keystrokes.
.Pp
If the action begins with a colon, the action will be entered into the
command prompt instead of being executed.
For example, "keybinding = :session open ,M1-s" will open the command
prompt with ":open session " entered when using the M1-s keybinding.
.Pp
Keybindings which open the command prompt may also include the string
<uri>, which will be replaced by the current tab's URI.
For example, "keybinding = :open <uri>,F10" will open the command
prompt with <uri> replaced with the current URI.
.Pp
GTK has some default keybindings for manipulating text inside input
fields, such as the URI or search entry widget, for example
.Cm C-w
deletes a word. To override these defaults prefix your key with an
exclamation mark, like this: "keybinding = tabclose,!C-w".
The
.Cm clearall
key word is special and is meant to reset the key binding list to the GTK+
and WebKit defaults.
This keyword should be the first
.Cm keybinding
entry in the configuration file.
.Pp
Shift should be used sparingly since it gets in the way of non-USA keyboards.
See the accompanying configuration file for examples.
.Pp
The various bindings are documented below.
The relevant keybinding action is given afterwards, in parentheses.
.Ss Command mode
These commands are used to focus or unfocus input on the default input of a web
page.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm ESC
Go to command mode; unfocus current entry on web page.
.Pq Cm command_mode
.It Cm i
Go to insert mode; focus on default entry on web page.
.Pq Cm insert_mode
.El
.Ss Search Commands
These commands are used to search for text strings within a web page.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm /
Start a search
.Pq Cm search
.It Cm \&?
Start a backwards search
.Pq Cm searchb
.It Cm n
Next item matching search
.Pq Cm searchnext
.It Cm N
Previous item matching search
.Pq Cm searchprev
.El
.Ss Focus Commands
These commands are used to shift the focus of
.Nm
from one area to another.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm F6
Focus on address bar
.Pq Cm focusaddress
.It Cm F7
Focus on search entry
.Pq Cm focussearch
.El
.Ss Command Aliases
These commands allow the user to map specific actions to specific keys.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm F1
Alias for "help"
.It Cm F2
Alias for "proxy toggle"
.It Cm F4
Alias for "toplevel toggle"
.El
.Ss Prompt Aliases
These commands allow the user to open a prompt.
These can be useful when the
.Fl S
option is used.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm F9
Alias for ":open "
.It Cm F10
Alias for ":open <uri>"
.It Cm F11
Alias for ":tabnew "
.It Cm F12
Alias for ":tabnew <uri>"
.El
.Ss Navigation Commands
These commands allow the user to navigate web pages and,
to some extent,
control the browser.
.Pp
.Bl -tag -width "Space, C-f, PageDownXXX" -offset indent -compact
.It Cm F5, C-r, C-l
Reload page
.Pq Cm reload
.It Cm Backspace, M-Left
Previous page
.Pq Cm goback
.It Cm S-BackSpace, M-Right
Forward page
.Pq Cm goforward
.It Cm j, Down
Next line on page
.Pq Cm scrolldown
.It Cm k, Up
Previous line on page
.Pq Cm scrollup
.It Cm G, End
Bottom of page
.Pq Cm scrollbottom
.It Cm gg, Home
Top of page
.Pq Cm scrolltop
.It Cm Space, C-f, PageDown
Page down
.Pq Cm scrollpagedown
.It Cm C-b, PageUp
Page up
.Pq Cm scrollpageup
.It Cm l, Right
Page right
.Pq Cm scrollright
.It Cm h, Left
Page left
.Pq Cm scrollleft
.It Cm $
Page far right
.Pq Cm scrollfarright
.It Cm 0
Page far left
.Pq Cm scrollfarleft
.It Cm M-f
Favorites
.Pq Cm fav
.It Cm M-j
Cookie jar
.Pq Cm cookiejar
.It Cm M-d
Download manager
.Pq Cm dl
.It Cm C-p
Print page
.Pq Cm print
.It Cm M-h
Global history
.Pq Cm history
.It Cm C-j
Toggle Java Script enabled for FQDN
.Pq Cm js
.It Cm C-s
Toggle source view
.Pq Cm togglesrc
.It Cm M-c
Toggle cookie enabled for FQDN
.Pq Cm cookie
.It Cm M-p
Toggle plugins enabled for FQDN
.Pq Cm plugin
.El
.Ss Tab Manipulation
.Nm
supports tabbed browsing.
That is, web pages may be opened in separate tabs,
allowing the user to quickly move from one page to another,
and back.
These commands then are used to create, destroy, and move between tabs.
.Pp
.Bl -tag -width "C-plus, C-equalXXX" -offset indent -compact
.It Cm C-MB1
Open new tab with the clicked link
.It Cm C-t
Create new tab with focus in URL entry
.Pq Cm tabnew
.It Cm C-T
Create new tab with focus in URL entry as the last tab in the browser
.Pq Cm 999tabnew
.It Cm C-w
Destroy current tab
.Pq Cm tabclose
.It Cm U
Undo close tab
.Pq Cm tabundoclose
.It Cm C-Left, C-PageUp
Go to the previous tab
.Pq Cm tabprevious
.It Cm C-Right, C-PageDown
Go to the next tab
.Pq Cm tabnext
.It Cm C-[1..9]
Jump to page
.Ar N
.Pq Cm tabnext [1..9]
.It Cm C-<
Jump to first page
.Pq Cm tabfirst
.It Cm C->
Jump to last page
.Pq Cm tablast
.It Cm C-minus
Zoom out by 4%
.Pq Cm focusout
.It Cm C-plus, C-equal
Zoom in by 4%
.Pq Cm focusin
.It Cm C-0
Set zoom level to 100%
.Pq Cm focusreset
.El
.Ss Yanking and pasting
These commands copy and paste text to and from the clipboard.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm p
Paste the contents of the clipboard into the address bar
.Pq Cm pasteuricur
.It Cm P
Paste the contents of the clipboard into a new tab
.Pq Cm pasteurinew
.It Cm y
Yank the current URL into the clipboard
.Pq Cm yankuri
.El
.Ss Hyperlink Following
This allows the user to follow hyperlinks
without using a mouse.
Enter the corresponding number to follow the link.
Alternatively one can type the name of the link and when there are no more
possibilities
.Nm
will follow the link.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm f, '.'
Highlight all links and prefix them with a number.
.Pq Cm hinting
.It Cm F, ','
Highlight all links and prefix them with a number but open in a new tab.
.Pq Cm hinting_newtab
.El
.Ss Exiting
Commands to exit the browser.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm C-q
Quit
.Pq Cm quitall
.El
.Ss Low-Contrast Color Scheme
These commands toggle the page style between the default CSS and a
low-contrast color scheme with light grey text on a dark grey background.
If the
.Cm userstyle
setting is changed, that stylesheet will be used instead of the
low-contrast color scheme.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm s
Toggle the current tab's style.
.Pq Cm userstyle
.It Cm S
Toggle the global page style mode.
Will also affect new tabs.
.Pq Cm userstyle_global
.El
.Ss Insert-mode commands
The following commands are only available when editing an input-field
.Pp
.Bl -tag -width Ds -offset indent -compact
.It Cm C-i
Edit the contents of the currently active input-element in an external editor.
.Pq Cm editelement
.El
.Sh COMMAND MODE
Command mode works in a similar fashion to the
.Xr vi 1
editor;
it is entered by typing a colon and exited by typing Esc.
The commands and their descriptions are listed below.
.Bl -tag -width Ds -offset indent
.It Cm about , version
Show the "About" page.
.It Cm buffers , ls , tabs
Displays the currently open tabs and lets the user switch tab by typing
the tab number or using the mouse.
.It Cm ca
Display CA certificates.
.It Cm cert , cert show
Download and display certificates of domain on tab.
.It Cm cert save
Save certificate into a local store.
The next time the site is visited it is compared against the store.
If the certificate matches,
the address bar will be blue;
if it doesn't the bar will be red.
.It Cm cookie
The
.Cm cookie
command is used to manipulate the cookie whitelist.
Used by itself it expands to
.Cm cookie show all .
.It Cm cookiejar
Show cookie jar contents.
.It Cm cookie purge
Remove all cookies from the cookie jar.
.It Cm cookie save, cookie save fqdn
Save the current fully qualified domain name (FQDN)
to the persistent whitelist.
For example,
the www.peereboom.us domain would result in saving .www.peereboom.us.
.It Cm cookie save domain
Save the top level domain name to the persistent whitelist.
For example,
the www.peereboom.us domain would result in saving .peereboom.us.
.Pp
This action enables cookies if it is currently disabled for this entry.
.It Cm cookie show all
Show all persistent and session entries in the cookie whitelist.
.It Cm cookie show persistent
Show all persistent entries in the cookie whitelist.
.It Cm cookie show session
Show all session entries in the cookie whitelist.
.It Cm cookie toggle domain
Toggle cookie support for the current top level domain.
.It Cm cookie toggle, cookie toggle fqdn
Toggle cookie support for the current FQDN.
.It Cm dl
Show download manager.
.It Cm encoding <encoding>
If
.Cm <encoding>
is set the tab's encoding will be set to
.Cm <encoding>
and
.Nm
reloads the tab.
If
.Cm <encoding>
is not set
.Nm
will display the current tab encoding.
.It Cm editsrc
Opens the source for the current tab in the editor specified by the
setting
.Cm external_editor
and then checks for changes to the file opened. If it is changed, the
page will be updated.
.It Cm editelement
If a text-element is currently active (<input> or <textarea>), it's
contents will be opened in the same fashion as for the command
.Cm editsrc
above
.It Cm fav
Show favorites.
.It Cm favadd
Add the current page to favorites.
.It Cm fullscreen , f
Toggle hiding tabs and url entry toolbar.
.It Cm h , hist , history
Show global history.
.It Cm help
Show help page.
.It Cm home
Go to home URL.
.It Cm js
The
.Cm js
command is used to manipulate the Java Script whitelist.
Used by itself it expands to
.Cm js show all .
.It Cm js save, save fqdn
Saves the FQDN to the persistent whitelist.
For example,
the www.peereboom.us domain would result in saving .www.peereboom.us.
.It Cm js save domain
Saves the top level domain name to the persistent whitelist.
For example,
the www.peereboom.us domain would result in saving .peereboom.us.
.Pp
This action enables Java Script if it is currently disabled for this entry.
.It Cm js show all
Shows all persistent and session entries in the JS whitelist.
.It Cm js show persistent
Shows all persistent entries in the JS whitelist.
.It Cm js show session
Shows all session entries in the JS whitelist.
.It Cm js toggle, js toggle fqdn
Toggle Java Script execution for the current FQDN.
.It Cm js toggle domain
Toggle Java Script execution for the current top level domain.
.It Cm loadimages
If auto_load_images is disabled, load all images for current site.
.It Cm open , op , o URL
Open URL.
.It Cm plugin
The
.Cm plugin
command is used to manipulate the plugin whitelist.
Used by itself it expands to
.Cm plugin show all .
.It Cm plugin save, save fqdn
Saves the FQDN to the persistent whitelist.
For example,
the www.peereboom.us domain would result in saving .www.peereboom.us.
.It Cm plugin save domain
Saves the top level domain name to the persistent whitelist.
For example,
the www.peereboom.us domain would result in saving .peereboom.us.
.Pp
This action enables plugins if they are currently disabled for this entry.
.It Cm plugin show all
Shows all persistent and session entries in the plugin whitelist.
.It Cm plugin show persistent
Shows all persistent entries in the plugin whitelist.
.It Cm plugin show session
Shows all session entries in the plugin whitelist.
.It Cm plugin toggle, plugin toggle fqdn
Toggle plugin execution for the current FQDN.
.It Cm plugin toggle domain
Toggle plugin execution for the current top level domain.
.It Cm print
Print page.
.It Cm proxy
The
.Cm proxy
command is used to manipulate the currently set proxy.
Used by itself it expands to
.Cm proxy show .
.It Cm proxy show
Displays the current
.Cm http_proxy
setting.
.It Cm proxy toggle
Enables or disables the proxy for
.Nm .
Note that
.Cm http_proxy
must be set before it can be toggled.
.It Cm qa , qall , quitall
Quit
.Nm .
.It Cm quit , q
Close current tab and quit
.Nm
if it is the last tab.
.It Cm restart
Restart
.Nm
and reload all current tabs.
.It Cm run_script [path_to_script]
Runs the script path_to_script with the current uri as the argument.
If path_to_script is not provided, the value of default_script is used
instead.
.It Cm script [filename]
Run an external JavaScript script file in the current tab context.
.It Cm session , Cm session show
Display the current session name.
By default the session name is main_session.
To create a new session use the
.Cm session save
command.
A session is defined as the lifetime of the browser application.
.It Cm session delete <session_name>
Delete session session_name from persistent storage.
If session_name is the current session then the session will revert to
main_session.
.It Cm session open <session_name>
Open session_name and close all currently open tabs.
Going forward this session is named session_name.
.It Cm session save <session_name>
Save current tabs to session_name session.
This will close the current session and going forward this session is named
session_name.
.It Cm set
The set command is used to inspect, clear or change runtime options.
There are 3 methods to use
.Cm :set .
When used by itself as
.Cm :set
the command displays all options as currently set.
.Pp
To set a value use
.Cm :set option=value .
For example,
.Cm :set http_proxy=http://127.0.0.1:8080 .
.Pp
To clear a value use
.Cm :set option= .
For example,
.Cm :set http_proxy= .
.Pp
Note, not all options can be set at runtime.
.It Cm stats
Show blocked cookie statistics.
These statistics vary based on settings and are not persistent.
.It Cm statustoggle , statust
Toggle status bar.
.It Cm stop
Stop loading the current web page.
.It Cm tabclose
Close current tab.
.It Cm tabhide
Hide tabs.
.It Cm tabnew , tabedit [URL]
Create new tab and optionally open provided URL.
.It Cm tabnext
Go to the next tab.
.It Cm tabonly
Close all tabs except the currently focused one.
.It Cm tabprevious
Go to the previous tab.
.It Cm tabshow
Show tabs in GUI.
.It Cm toplevel , toplevel toggle
Toggle the top level domain name cookie and JS session whitelist.
This is to enable/disable short lived full site functionality without
permanently adding the top level domain to the persistent whitelist.
.It Cm urlhide , urlh
Hide url entry and tool bar.
.It Cm urlshow , urls
Show url entry and tool bar.
.It Cm userstyle <stylesheet>
Toggle the current tab between using a custom stylesheet and the
page's default CSS.
If there is no stylesheet argument to this command, the stylesheet
specified by the
.Cm userstyle
setting will be used instead.
This
.Cm userstyle
setting is set by default to a low-contrast color scheme.
If a stylesheet is specified, the current tab will be toggled with
this stylesheet instead.
.Pp
If the
.Cm userstyle
setting is left unchanged, this command without any arguments will
toggle between the default page's CSS and the low-contrast color
scheme.
.Pp
Additional stylesheets may be used in addition to the low-contrast
color scheme by specifying additonal keybindings.  For example,
.Pp
.D1 keybinding = userstyle ~/style.css,v
.D1 keybinding = userstyle_global ~/style.css,V
.Pp
will map toggling between ~/style.css to the v and V keys while
keeping the low-contrast feature mapped to the s and S keys.
.It Cm userstyle_global <stylesheet>
Same as
.Cm userstyle
but the change affects all open tabs, and newly created tabs will use
this style.
.It Cm w
Save open tabs to current session.
The tabs will be restored next time the session is opened.
See the session command for additional details.
.It Cm wq
Save open tabs and quit.
The tabs will be restored next time
.Nm
the session is opened.
See the session command for additional details.
.El
.Sh BUFFER COMMANDS
In addition to shortcuts and commands
.Nm
provides buffer commands. Buffer commands are short, multi character
vi-like commands, often requiring an argument. Partial buffer commands
are
displayed in the buffer command statusbar element (see
.Cm statusbar_elems ) .
Pressing Esc or switching to another tab cancels a partially entered
buffer command. In the following list
.Cm arg
denotes the argument a buffer command accepts. Buffer commands are
defined as extended regular experssions.
Note that if a character is used as a shortcut it will not be interpreted
as the beginning of a buffer command. This is the case with
.Cm 0 .
.Pp
.Bl -tag -width "['][a-zA-Z0-9]XXX" -offset indent -compact
.It Cm gg
go to the top of the page
.It Cm gG
go to the bottom of the page
.It Cm [0-9]+%
go to the
.Cm arg
percent of the page
.It Cm zz
go to 50% of the page
.It Cm [0-9]*gu
go
.Cm arg
levels up. If
.Cm arg
is missing, 1 is assumed. Going a
level up means going to a URI obtained from the current one by removing
the last slash ('/') character and everything that follows it
.It Cm gU
go to the root level, i.e. going up as many levels as possible.
.It Cm gh
open the home page in the current tab
.It Cm m[a-zA-Z0-9]
set a mark denoted by
.Cm arg
at the current page position. These marks behave like those in vi or
less.
.It Cm ['][a-zA-Z0-9']
go to the position where mark
.Cm arg
was set. The special mark "'" points to the previous page position, after a
"gg", "gG", "zz", "%" or "'" buffer command.
.It Cm M[a-zA-Z0-9]
set the current uri as quickmark
.Cm arg
.It Cm go[a-zA-Z0-9]
open the uri marked as quickmark
.Cm arg
in the current tab
.It Cm gn[a-zA-Z0-9]
open the uri marked as quickmark
.Cm arg
in a new tab
.It Cm [0-9]+t
activate tab number
.It Cm g0
go to first tab
.It Cm g$
go to last tab
.It Cm [0-9]*gt
go to the
.Cm arg
next tab
.It Cm [0-9]*gT
go to the
.Cm arg
previous tab
.Cm arg
.It Cm ZZ
quit
.Nm
.It Cm ZR
restart
.Nm
.It Cm zi
zoom in by 4%
.It Cm zo
zoom out by 4%
.It Cm z0
set zoom level to 100%
.It Cm [0-9]+Z
set zoom level to
.Cm arg
%
.El
.Sh QUICKMARKS
Quickmarks are like bookmarks, except they are refered to by a single
character (a letter or a digit), instead of a longer name. See the
.Cm M[a-zA-Z0-9] ,
.Cm go[a-zA-Z0-9]
and
.Cm gn[a-zA-Z0-9]
buffer commands for usage. Quickmarks are stored in
.Pa ~/.xombrero/quickmarks
and are saved automatically after each
.Cm M[a-zA-Z0-9]
buffer command.
.Sh ABOUT SCREENS
The about screens are internally generated web pages by
.Nm
for user interaction.
These are entered in the address bar and the format is
.Cm about:screen
where screen is the desired screen to display.
For example about:favorites.
Any about screen can be used as the home page as specified by
.Cm home
in the configuration file.
.Pp
.Bl -tag -width "downloadsXXX" -offset indent -compact
.It Cm about
show the about screen
.It Cm blank
show a blank screen
.It Cm cookiewl
show the cookie whitelist screen
.It Cm cookiejar
show the cookiejar screen
.It Cm downloads
show the downloads screen
.It Cm favorites
show the favorites screen
.It Cm help
show the help web page
.It Cm history
show the history screen
.It Cm jswl
show the Java Script whitelist screen
.It Cm set
show the settings screen
.It Cm stats
show the statistics screen
.El
.Sh WHITELISTS
This section describes advanced usage settings.
Most users should use
.Cm browser_mode
instead to setup
.Nm
and skip over this section.
.Pp
.Nm
has a number of whitelists to control blocking cookies and Java Script
execution for FQDNs or domains.
When properly enabled these whitelists require either the FQDN or top level
domain to exist in the whitelists in order to allow cookies to be stored or
Java Script to execute.
Both Java Script and cookies have two whitelists associated with them.
The whitelists are called session and persistent.
Items in the session whitelists are only allowed for the lifetime of the
.Nm
instance.
Items in the persistent whitelists are stored on disk and are restored
upon restarting.
.Pp
Setting up the whitelists is a little tricky due to intricacies of WebKit.
In fact the semantics are different for cookies and Java Script.
.Pp
Cookie whitelist requires the following configuration to be set:
.Pp
.Bl -tag -width "enable_cookie_whitelistXXX" -offset indent -compact
.It Cm cookies_enabled
This is a WebKit setting and must be set to
.Pa 1
(ENABLED)
in order to be able to use a
cookie whitelist.
.It Cm enable_cookie_whitelist
This needs to be set to
.Pa 1
to enable the cookie whitelist functionality.
.It Cm cookie_wl
These entries in the configuration file are the actual domains names in the
cookie whitelist.
.El
.Pp
Java Script whitelist requires the following configuration to be set:
.Pp
.Bl -tag -width "enable_js_whitelistXXX" -offset indent -compact
.It Cm enable_scripts
This is a WebKit setting and must be set to
.Pa 0
(DISABLED)
in order to be able to use a
Java Script whitelist.
.It Cm enable_js_whitelist
This needs to be set to
.Pa 1
to enable the Java Script whitelist functionality.
.It Cm js_wl
These entries in the configuration file are the actual domains names in the
Java Script whitelist.
.El
.Pp
Plugin whitelist requires the following configuration to be set:
.Pp
.Bl -tag -width "enable_plugin_whitelistXXX" -offset indent -compact
.It Cm enable_plugins
This is a WebKit setting and must be set to
.Pa 1
(ENABLED)
in order to be able to use a
plugin whitelist.
.It Cm enable_plugin_whitelist
This needs to be set to
.Pa 1
to enable the plugin whitelist functionality.
.It Cm pl_wl
These entries in the configuration file are the actual domains names in the
plugin whitelist.
.El
.Pp
See the
.Pa FILES
section for additional configuration file entries and details
that alter runtime behavior.
.Sh FILES
.Bl -tag -width "/etc/xombrero.confXXX" -compact
.It Pa ~/.xombrero.conf
.Nm
user specific settings.
.It Pa ~/.xombrero
.Nm
scratch directory.
.El
.Pp
.Nm
tries to open the user specific file,
.Pa ~/.xombrero.conf .
If that file is unavailable,
it then uses built-in defaults.
Any settings saved at runtime will be saved to the file
.Pa ~/.xombrero/runtime
and will be loaded as well.
.Pp
The format of the file is \*(Ltkeyword\*(Gt = \*(Ltsetting\*(Gt.
For example:
.Pp
.Dl http_proxy = http://127.0.0.1:8080
.Pp
Enabling or disabling an option is done by using 1 or 0 respectively.
.Pp
The file supports the following keywords:
.Pp
.Bl -tag -width "enable_cookie_whitelistXXX" -offset indent -compact
.It Cm alias
Defines an alias for a given URL, so that the URL is loaded when the alias is
entered in the address bar.
If the aliased URL includes a %s format specifier, then any argument given after
the alias on the address bar is substituted.
For example, if g,http://www.google.com/search?q=%s is defined as an alias,
then the URL http://www.google.com/search?q=foo is loaded when navigating to
"g foo".
.It Cm allow_insecure_content
If set, all content referenced by a page will be loaded.
If unset, encrypted pages will refuse to load content that is linked
from an insecure location.
.It Cm allow_insecure_scripts
If set, all scripts referenced by a page will be loaded and run using
the current javascript policy.
If unset, encrypted pages will refuse to run scripts that are linked
from an insecure location.
.It Cm allow_volatile_cookies
If set cookies are stored in the session cache but will be discarded once
.Nm
exits.
Unfortunately enabling this does allow for some limited tracking on the web.
.It Cm append_next
When set a new tab is appended after the current tab instead of being appended
as the last tab.
.It Cm auto_load_images
If disabled, images will not be loaded automatically.
.It Cm autofocus_onload
When set a tab that is loaded will attempt to autofocus the default input
entry.
This is only done for tabs that are currently visible.
.It Cm browser_mode
The
.Nm
browser has 3 default operating modes:
.Pa normal
(the default),
.Pa whitelist
and
.Pa kiosk .
In the
.Pa normal
mode the browser allows all cookies, plugins and Java Script as any other
browser would.
This means that all cookies are saved to persistent storage and that all
Java Script and plugins run.
.Pp
On the other hand, using the
.Pa whitelist
mode enables whitelists.
This requires the user to add all the required
.Pa cookie_wl ,
.Pa js_wl
and
.Pa pl_wl
items.
If a domain does not appear in the whitelists
.Nm
disallows cookies, Java Script and plugin execution.
If insecure web content or scripts are referenced by a secure website,
they will be blocked from loading or running.
.Pp
In
.Pa kiosk
mode the browse works just like
.Pa normal
mode however the toolbar only has the backward, forward and home button.
.Pp
This setting must be the first entry in
.Pa ~/.xombrero.conf
because it sets advanced settings that can be overridden later in the file.
See the default config file for more details.
.It Cm cmd_alias
This setting is used to define an alias for a command.
The syntax of this setting is
.Pa cmd_alias = alias,cmd .
For example, if you wanted to set an alias for the
.Pa tabnew
command to
.Pa tn ,
add the line
.Pa cmd_alias = tn,tabnew
to your
.Pa ~/.xombrero.conf .
This setting may not begin with a number.
.It Cm cmd_font
Set the command prompt font.
E.g.
.Pa cmd_font = monospace normal 9 .
.It Cm color_visited_uris
When enabled (the default)
.Nm
will color visited links. This is done while the web page loads using
JavaScript, rather than WebKit's (broken, see bug #51747) built-in
facility for coloring visited links. The JavaScript approach is
(probably) slower and is not consistent across tabs (unless the tabs are
reloaded), but has the advantage of not leaking history data to web
pages (see http://wtikay.com/docs/details.html).
.It Cm cookie_policy
This field delineates the cookie policy.
Possible values are: no3rdparty, reject 3rd party cookies.
accept, accept all cookies.
reject, reject all cookies.
.It Cm cookie_wl
This is a cookie whitelist item.
Use multiple times to add multiple entries.
Valid entries are for example *.moo.com and the equivalent .moo.com.
A fully qualified host is also valid and is for example www.moo.com.
.It Cm cookies_enabled
Enable cookies.
.It Cm ctrl_click_focus
Give focus in newly created tab instead of opening it in the background.
.It Cm custom_uri
This setting provides the ability to run custom executables for
special URIs.
The syntax for this setting is
.Pa custom_uri\ =\ protocol,command .
The URI is passed as a single argument to
.Pa command
to be parsed and executed.
.Pp
For example, to add the ability to use custom
.Pa mailto
URIs, add the setting
.Pa custom_uri = mailto,command
where
.Pa command
is a program that will parse the
.Pa mailto
URI and open your mail client.
.It Cm default_script
Path to the script used as the default value for the run_script
command.
.It Cm default_zoom_level
Set the default browsing zoom level.
.It Cm do_not_track
Sets the HTTP Do Not Track header to tell sites that you wish to be
opted-out of 3rd-party tracking for the use of behavioral advertising.
Not all sites currently support this header, and this is only a
suggestion of a user preference.
Sites may still perform 3rd-party tracking even when this feature is
enabled.
Default is 0.
.It Cm download_dir
Locations where files are downloaded to.
This directory must exist and
.Nm
validates that during startup.
.It Cm download_mode
Controls how downloads are handled.
Possible values are:
.Bd -literal -offset indent
start - automatically start download.
ask   - ask user for confirmation.
add   - add to downloadmanager, but
        do not start.
.Ed
The default is "start".
.It Cm download_notifications
When enabled a message is shown when downloads are finished.
Default is 0.
.It Cm enable_autoscroll
When enabled clicking MB3 will spawn the autoscroll ball, scrolling can
then proceed by dragging the mouse away from the ball.
.It Cm enable_cookie_whitelist
When enabled all cookies must be in the whitelist or they are rejected.
Additionally whitelisted cookies also enable HTML5 local storage for the
domain.
.It Cm enable_favicon_entry
When enabled (the default)
.Nm
displays the favicon of the web page at the URI entry. This setting
affects both
.Cm normal
and
.Cm compact
tabs.
.It Cm enable_favicon_tabs
When enabled (disabled by default)
.Nm
displays favicons at each tab. This setting only affects
.Cm compact
tabs.
.It Cm enable_js_autorun
Enables support for autorunning JavaScript after page loads.  When
enabled,
.Pa ~/.xombrero/js/
will be searched for
.Pa default.js
and
.Pa host.domain.js .
If
.Pa host.domain.js
does not exist,
.Pa domain.js
will be tried instead.  The content of the both default and
host/domain files are read and executed on each page load.
Default is 1.
.Pp
As an example, if you add the line
.Pa alert("Hello, world");
to your
.Pa default.js ,
a pop-up displaying "Hello, world" will be shown on every page reload.
While not useful, any javascript can be run through this mechanism,
making it useful for global or site-specific modifications.
.It Cm enable_js_whitelist
When enabled all domains must be in the js whitelist in order to run Java
Script.
NOTE: Make sure
.Cm enable_scripts
is set to 0.
.It Cm enable_plugin_whitelist
When enabled all domains must be in the plugin whitelist in order to run
plugins.
NOTE: Make sure
.Cm enable_plugins
is set to 0.
.It Cm enable_plugins
Enable external plugins such as Flash and Java.
.It Cm enable_strict_transport
Enable support for the Strict-Transport-Security HTTP-header.
When enabled, sites that set this flag will only be visited via HTTPS.
Default value is 1
.It Cm enable_scripts
Enable Java Script.
.It Cm enable_socket
When enabled the first instance of
.Nm
will create a socket in the
.Pa ~/.xombrero
directory.
Using the -n url option on subsequent
.Nm
invocations will cause the specified URL to be loaded in a new tab.
Only a user with identical UID and GID can use this option.
.It Cm enable_localstorage
Enable html5 Local Storage.
.It Cm enable_spell_checking
Enables spell checking. Preferred languages can be set using
.Cm spell_check_languages
option.
.It Cm encoding
Set the default encoding.
E.g.
.Pa encoding = ISO-8859-1 .
.It Cm external_editor
Set which editor to use for external editing.
the string <file> will be replaced by the current filename.
E.g.
.Pa external_editor = gvim -f <file>
Note!
.Cm xombrero
relies on the editor
.Pa not forking
into the background.
.It Cm fancy_bar
Enables a backward, forward, and stop button to the toolbar.
Additionally if
.Cm search_string
is set it'll enable an entry box for searches.
.It Cm guess_search
When enabled
.Nm
will try to guess if the string you entered, in the URI entry widget or
the command widget, is term you want to search for using search_string
(see above).
If the string does not contain a dot nor a slash, is not a
path to a local file and does not resolves to an IP then it is assumed
to be a search term.
.It Cm gui_mode
To simplify configuring
.Nm
allows you pick between two GUI modes:
.Pa classic
(the default) and
.Pa minimal .
In the
.Pa classic
mode the GUI looks similar to that of most mainstream browsers. While in
.Pa minimal
mode the GUI looks more vi-like. One can get a GUI between the two by
tweaking the low-level GUI settings found under the advanced GUI setting
section in the configuration file.
.It Cm history_autosave
When enabled
.Nm
will save all command and search history.
Upon restarting
.Nm
the saved command and search history will be restored.
.It Cm home
Homepage in URL format.
.It Cm http_proxy
Proxy server in URL format.
.Nm
overrides
.Cm http_proxy
if it is specified as an environment variable.
It must be noted that on older webkit versions one MUST use an IP address and
not a FQDN.
This works as expected with webkit 1.4.2.
.Pp
If one desires to use a socks proxy then an intermediary tool must be used.
It has been reported that tsocks and polipo work with
.Nm .
.It Cm http_accept
If set, the HTTP Accept header will be modified for each text/html request.
If this setting is set multiple times, the Accept header will be changed
in a round-robin order for every text/html request on a tab.
Because this setting rotates through Accept headers on each text/html
request, a single page may rotate through more than one Accept header
if multiple text/html requests are made.
.Pp
Note that this setting only rewrites the Accept header for text/html
requests.  Other requests will use WebKit's default  Accept header.
.It Cm http_proxy_starts_enabled
If set to 0, the http_proxy will be disabled at startup. The user can later
enable the proxy with the
.Cm proxy toggle
command or keybinding.
.It Cm icon_size
Permits icon sizes to be changed if
.Cm fancy_bar
is enabled.
Size 1 is small; 2 is normal; 3 through 6 are progressively larger.
.It Cm include_config
This must be a path to another configuration file.
Configuration files are usually read from top to bottom, however, if
this option is set,
.Nm
will begin reading the included file at this location and continue
reading the rest of the configuation after the included file has
finished being read.
.Pp
Any simple settings set before the include may
be overridden by settings in the included file, and any simple
settings set in the included file may be overridden later by settings
after the include or at runtime using the
.Cm :set
command.
However, database settings (for example,
.Cm cookie_wl , js_wl , pl_wl ,
and
.Cm keybinding )
are only ever added to the database, and so the order of an included
configuration file is not pertinent to these database settings.
.Pp
This feature is likely best used as the last item in
.Pa ~/.xombrero.conf .
.It Cm js_wl
This is a Java Script whitelist item.
See
.Cm cookie_wl
for semantics and more details.
.It Cm max_connections
The maximum number of connections that
.Nm
can open at once.
.It Cm max_host_connections
The maximum number of connections that
.Nm
can open at once to a given host.
.It Cm mime_type
Sets an action for a specific or default MIME type.
For example, to download and view a pdf using kpdf set
.Pa mime_type = application/pdf,kpdf .
To set a default value use *, for example,
.Pa mime_type = video/*,mplayer .
Note that the action is only passed the URL and not all applications are
capable of dealing with a URL and therefore one might have to create a wrapper
script to download the content first.  Alternatively one can add the
.Pa @
in front of the MIME type to indicate "download first".
For example,
.Pa mime_type = @application/pdf,xpdf .
When
.Pa @
is use the file will be downloaded to the
.Pa download_dir
before the MIME handler is called.
.Pp
The special binary name "donothing" may be used to ignore a MIME type
without displaying any warnings from being unable to execute the
binary.
.It Cm oops_font
Set the font used to display error messages.
E.g.
.Pa oops_font = monospace normal 9 .
.It Cm pl_wl
This is a plugin whitelist item.
See
.Cm cookie_wl
for semantics and more details.
.It Cm read_only_cookies
Mark cookies file read-only and discard all cookies once the session is
terminated.
.It Cm refresh_interval
Refresh interval while in the download manager.
The default is 10.
.It Cm referer
Control how 'Referer' is handled in http-requests.
.Bd -literal -offset indent
always      - always send referer
never       - never send referer
same-domain - only send referer if it's
              for the same public suffix - this means that
              it's ok for subdomains to refer to each other
same-fqdn   - only send referer if it's FQDN match
.Ed
Any other value that is also a valid URL will use this
custom value as referer. (E.g. you could set it to http://no-referer.com)
The default value is "always"
.It Cm resource_dir
Directory that contains various
.Nm
resources such as icons.
This is OS-specific and should be handled by the porter.
.It Cm save_global_history
If set the global history will be saved to
.Pa ~/.xombrero/history
when quitting
and restored at startup.
See the
.Sx KEY BINDINGS
section above for how the global history is accessed.
Global history is not saved to disk by default.
.It Cm save_rejected_cookies
Saves rejected cookies in cookie format in {work_dir}/rejected.txt.
All cookies are saved and unlike a cookie jar they are never replaced.
Make sure there is enough disk space to enable this feature.
.It Cm search_string
Default search engine string.
See the
.Pa xombrero.conf
file for details.
.It Cm session_autosave
Enable session auto-saving when changing state (e.g. adding or removing a tab).
The session name is what is currently in use and is described in the
.Cm session save
and
.Cm session open
commands.
.It Cm session_timeout
This value is the time that is added in seconds to a session cookie.
.It Cm show_tabs
Enable or disable showing tabs.
.It Cm show_url
Enable or disable showing the url and toolbar.
.It Cm show_scrollbars
Enable or disable the showing of the horizontal and vertical scrollbars.
Disabling this setting requires GTK3.
.It Cm show_statusbar
Enable or disable showing the status bar.
.It Cm single_instance
If set and
.Cm enable_socket
is enabled only one
.Nm
will be permitted to run.
If there is a URL specified it will be opened in a new tab in the already
running
.Nm
session.
.It Cm spell_check_languages
The languages to be used for spell checking, separated by commas. For example,
en_US.
.It Cm ssl_ca_file
If set to a valid PEM file
all server certificates will be validated against it.
The URL bar will be colored green (or blue when saved) when the certificate is
trusted and yellow when untrusted.
.Pp
If
.Cm ssl_ca_file
is not set, the URL bar will be colored red if the certificate has not
been saved, or blue if it has been saved.
.Pp
WebKit only supports a single PEM file.
Many OS' or distributions have many PEM files.
One can simply concatenate all separate files into one large one.
E.g.
.Cm for i in `ls`; do cat $i >> cert.pem; done
and use the resulting cert.pem file as the input to
.Cm ssl_ca_file .
It is advisable to periodically recreate the cert.pem file.
.It Cm ssl_strict_certs
If this value is set connections to untrusted sites will be aborted.
This value is only used if
.Cm ssl_ca_file
is set.
.It Cm statusbar_elems
Define the components of the status bar. The possible components are:
.Bd -literal -offset indent
| - separator
P - page progress percent
p - proxy enabled/disabled
B - buffer command
Z - page zoom level
T - current tab number
.Ed
The default is "BP".
These components show nothing if there is nothing worth showing, like
zoom amount 100%.
.It Cm statusbar_font
Set the status bar font.
E.g.
.Pa statusbar_font = monospace normal 9 .
.It Cm statusbar_style
Set the status bar style to either
.Cm url
- display the current url, or
.Cm title
- display the page title. The default is
.Cm url .
.It Cm tab_style
Set the tab style to either
.Cm normal
- the default gtk notebook tabs, or
.Cm compact
for an alternative.
You can switch the tab style with the
.Pa tabnextstyle
command.
.It Cm tabbar_font
Set the compact tab bar font.
E.g.
.Pa tabbar_font = monospace normal 9 .
.It Cm url_regex
This is the regular expression that is used to match what constitutes a valid
URL when using
.Pa guess_search .
.It Cm user_agent
Set to override the default
.Nm
user-agent string. May be specified several times for switching between
user-agents.
.It Cm userstyle
Set the stylesheet to be used as a default for the
.Cm userstyle
and
.Cm userstyle_global
commands when no extra parameters are given.
The default is a low-contrast stylesheet.
.It Cm userstyle_global
When enabled new tabs will automatically be displayed using the custom
stylesheet specified by the
.Cm userstyle
setting.
.It Cm warn_cert_changes
When enabled all SSL certificates from HTTPS websites will be
cached in the
.Cm ~/.xombrero/certs_cache/
directory.
On each page load, if the remote certificate differs from the cached
local version, a warning page with options of what to do next will be displayed
instead of the requested page.
This feature may be used in addition to the coloring of the URL bar and
can be used to help prevent against man-in-the-middle attacks, even if
the new remote certificate is signed by a trusted certificate
authority in
.Cm ssl_ca_file .
Default is 0.
.It Cm window_height
Set the default height of the browser window.
.It Cm window_width
Set the default width of the browser window.
.It Cm window_maximize
Maximize the browser window at startup.
.It Cm work_dir
Set the work directory where all
.Nm
scratch files are stored.
Default is
.Cm ~/.xombrero .
.El
.Sh HISTORY
.Nm
was inspired by vimprobable2 and the bloat in other
.Ux
web browsers.
.Sh AUTHORS
.An -nosplit
.Nm
was written by
.An Marco Peereboom Aq marco@peereboom.us ,
.An Stevan Andjelkovic Aq stevan@student.chalmers.se ,
.An Edd Barrett Aq vext01@gmail.com ,
.An Todd T. Fries Aq todd@fries.net ,
.An Raphael Graf Aq r@undefined.ch ,
.An Michal Mazurek Aq akfaew@jasminek.net ,
and
.An Josh Rickmar Aq jrick@devio.us .