Custom file handling

Long press the settings button, check the option "custom file handling" to enable the functionality.

The custom file handling configuration file is "/sdcard/uweb/default.filecap", each line of it has the format as follows:
[file extension]:[mimetype]:[command line]

The "[file extension]" part can have at most two-segment of extensions such as "txt.xz","html.gz".
"[mimetype]" indicates the type of "[command line]" output.
"[command line]" is same as the one in default.cmds. The most often used replacements are:
%u (url), %U (urlencoded url), %c (cookie), %p (site password, curl format).

/sdcard/uweb/default.filecap example:

txt:text/html:curl %p "%u"
mp3:text/html:echo '<audio controls width=100% height=100%><source src="%u"></audio>'
m4b:text/html:echo '<audio controls width=100% height=100%><source src="%u"></audio>'
m3u8:text/html:echo '<video controls width=100% height=100%><source src="%u"></video>'
mp4:text/html:echo '<video controls width=100% height=100%><source src="%u"></video>'
mkv:text/html:echo '<video controls width=100% height=100%><source src="%u"></video>'
doc:uweb:echo http://docs.google.com/gview?embedded=true&url=%U
xls:uweb:echo http://docs.google.com/gview?embedded=true&url=%U
ppt:uweb:echo http://docs.google.com/gview?embedded=true&url=%U
docx:uweb:echo http://docs.google.com/gview?embedded=true&url=%U
xlsx:uweb:echo http://docs.google.com/gview?embedded=true&url=%U
pptx:uweb:echo http://docs.google.com/gview?embedded=true&url=%U
xz:text/plain:curl %p "%u"|xz -d --

Examples for html5 application:

pdf:uweb:echo file:///sdcard/uweb/app/pdf.js/web/viewer.html?file=%u
djvu:uweb:echo file:///sdcard/uweb/app/djvu.html?url=%u
epub:uweb:echo file:///sdcard/uweb/app/reader/index.html?bookPath==%u