Function getBrowserInfo

  • EN: Browser Information

    ZH: 返回浏览器信息


    const ret = getBrowserInfo();




    Attribute Description Type Values
    system System string android, ios, windows, macos, linux
    systemVs System version string Windows: 2000, xp, 2003, vista, 7, 8, 8.1, 10 macOS: ...
    platform Platform string desktop, mobile
    engine Engine string webkit, gecko, presto, trident
    engineVs Engine version string -
    supporter Supporter string edge, opera, chrome, safari, firefox, iexplore
    supporterVs Supporter version string -
    shell Shell string (Optional) wechat, qq_browser, qq_app, uc, 360, 2345, sougou, liebao, maxthon, bilibili
    shellVs Shell version string (Optional) 20/...
    appleType Apple device type string (Optional) ipad, iphone, ipod, iwatch

    Example: Determine the environment of the mobile QQ.

    const { system, shell } = getBrowserInfo();
    const isMobileQQ = ['android', 'ios'].includes(system) && ['qq_browser', 'qq_app'].includes(shell);

    Returns BrowserInfo