detect browser environment