Don't set window title before "load" event, for old Firefox versions
Use better way to extract file name from URI