remove the use of navigator.userAgent