safer read of vars off of js/window

* don't throw exception if not present