====== Custom error pages ====== Create custom html pages that will be displayed when a load error occurs. **NOTE: This requires uzbl experimental!** ==== Uzbl configuration ==== In order to catch load errors we need to attach to uzbl's LOAD_ERROR event. We simply launch a script when the event is raised, which takes the reason of the error as argument and returns pretty formated HTML. @on_event LOAD_ERROR set inject_html = \@($XDG_DATA_HOME/uzbl/scripts/load-error.sh '%1')\@ ==== Script ==== The load-error.sh script's purpose is to replace the reason of error in a HTML template file with the one provided by the LOAD_ERROR event. As you see above we pass the reason of error to he script using the positional parameter %1. The script will now read the HTML template and replace a string %%___REASON___%% with the passed in error reason. The load-error.sh script: #!/bin/sh # # TEMPLATE=/path/to/load-error.html sed -e "s,___REASON___,$1," $TEMPLATE | sed -e 's#\(http.*\) [0-9]:\(.*\)#\2: \1#' ==== Template ==== Use the string %%___REASON___%% somewhere inside the HTML template which will be replaced with the actual reason of error.
The page you requested cannot be displayed.

___REASON___