test: use is_browser instead of try/catch to detect browser.