be a bit cleaner to do:

     return (typeof chrome ......)

?