test for existence of navigator
add saveAs.unload to prevent memleaks