next-useragentnext.js 解析用户代理字符串工具
next-useragent 用于为 next.js 解析浏览器的用户代理字符串。
安装
$ npm install next-useragent
用法
next-useragent 的用法非常简单,使用withUserAgent
方法,可以随时随地访问用户代理的详细信息。
- 作为 getInitialProps 方法的参数传递。
- 作为 React 组件的属性传递。
高阶组件
import React from 'react' import dynamic from 'next/dynamic' import { WithUserAgentProps, withUserAgent } from 'next-useragent' const DesktopContent = dynamic(() => import('./desktop-content')) const MobileContent = dynamic(() => import('./mobile-content')) class IndexPage extends React.Component<WithUserAgentProps> { static async getInitialProps(ctx) { return { useragent: ctx.ua.source } } render() { const { ua, useragent } = this.props return ( <> <p>{ useragent }</p> { ua.isMobile ? ( <MobileContent /> ) : ( <DesktopContent /> ) } </> ) } } export default withUserAgent(IndexPage)
评论
BaresipSIP 用户代理
Baresip是一个可移植的模块化的SIP用户代理,支持音频和视频。特点Audiocodecs:AMR,BV32,Celt,G.711,G.722,G.722.1,GSM,iLBC,L16,OPUS,
BaresipSIP 用户代理
0
xhtml-enginexhtml 字符串解析引擎
基于node.js开发的xhtml字符串解析引擎。本项目是一个处理HTML模板的引擎,你可以用类似jQuery的方式去操作一段字符串模板,比如Vue-loader根据template生成render函
xhtml-enginexhtml 字符串解析引擎
0
TinyDnsProxyDNS代理工具
简单的跨平台DNS代理工具,支持远端TCP连接,支持自定义HOSTS文件。使用方法:$ dnsproxy -hUsage: dnsproxy [options] -d or --daemon
TinyDnsProxyDNS代理工具
0