Function client

The client method returns a browser judgment result: { ANDROID: true, GECKO: true, GLSH_APP: false, IE: false, IOS: false, IPAD: false, IPHONE: false, MOBILE: true, MOBILEDEVICE. true, OPERA: false, QQ: false, QQBROWSER: false, TRIDENT: false, WEBKIT: true, WEIXIN: false }

Will be refactored for the next major release

1.0.1

  • Parameters

    • name: string = ''

      optional, e.g. pass in MicroMessenger to return whether it is the built-in browser of Weixin

    • userAgent: string = navigator.userAgent

      optional, pass in a custom ua, default takes the browser's navigator.userAgent

    Returns
        | boolean
        | {
            IE: boolean;
            GECKO: boolean;
            WEBKIT: boolean;
            OPERA: boolean;
            TRIDENT: boolean;
            MOBILE: boolean;
            IOS: boolean;
            ANDROID: boolean;
            IPHONE: boolean;
            IPAD: boolean;
            QQBROWSER: boolean;
            WEIXIN: boolean;
            QQ: null
            | RegExpMatchArray;
        }

    • the common ua match table, if name is passed, then returns whether the terminal matches true/false