6.0.3 • Published 2 months ago

@ima/plugin-useragent v6.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
2 months ago

@ima/plugin-useragent

Installation

npm install @ima/plugin-useragent --save
// /app/build.js

var vendors = {
    common: [
        '@ima/plugin-useragent'
    ]
};

/*
Now is plugin UserAgent available from:

ns.ima.plugin.userAgent.PlatformJS;
ns.ima.plugin.userAgent.ClientUserAgent;
ns.ima.plugin.userAgent.ServerUserAgent;
ns.ima.plugin.userAgent.UserAgent;

import { PlatformJS, ClientUserAgent, ServerUserAgent, UserAgent } from '@ima/plugin-useragent';
*/
// /app/config/bind.js
import { UserAgent } from '@ima/plugin-useragent';

oc.bind('UserAgent', UserAgent);

##Usage

// /app/config/bind.js
oc.bind('Foo', ns.App.Foo, ['UserAgent']);
// /app/foo.js
class Foo {
	constructor(userAgent) {
		...
		var os = userAgent.getOSFamily();

		var browser = userAgent.getName();

		var version = userAgent.getVersion();
		if (version !== 'unknown' ) {
			browser += version;
		}

		var os = userAgent.getOSFamily();
		...
	}
}
6.0.3

2 months ago

6.0.2

2 months ago

6.0.1

2 months ago

6.0.0

2 months ago

5.0.1

1 year ago

5.0.0

1 year ago

5.0.0-rc.3

1 year ago

5.0.0-rc.4

1 year ago

5.0.0-rc.5

1 year ago

5.0.0-rc.0

1 year ago

5.0.0-rc.1

1 year ago

5.0.0-rc.2

1 year ago

4.0.0-rc.10

2 years ago

4.0.0-rc.9

2 years ago

4.0.0-rc.8

2 years ago

4.0.0-rc.11

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.0-rc.5

2 years ago

4.0.0-rc.4

2 years ago

4.0.0-rc.7

2 years ago

4.0.0-rc.6

2 years ago

4.0.0-rc.3

2 years ago

4.0.0-rc.2

2 years ago

4.0.0-rc.1

2 years ago

4.0.0-rc.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.2

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago