User Tools

Site Tools


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/ '%1')\@


The 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 script:



sed -e "s,___REASON___,$1," $TEMPLATE | sed -e 's#\(http.*\) [0-9]:\(.*\)#<span style="color:red">\2:</span> <a href="\1">\1</a>#'


Use the string ___REASON___ somewhere inside the HTML template which will be replaced with the actual reason of error.

        <div align="center">
            <table border="0">
                        <img src="">
                        The page you requested cannot be displayed.
custom-error-page.txt · Last modified: 2016/08/31 14:10 (external edit)