mirror of
https://github.com/lancedikson/bowser
synced 2026-03-02 03:40:27 +00:00
adding detection for Roku OS: https://en.wikipedia.org/wiki/Roku#Software
examples: http://www.webapps-online.com/online-tools/user-agent-strings/dv/brand798903/roku-dvp note: The reason I added the test for Roku before all other tests is that Roku user agents might contain other tokens (like Windows), but Roku is still Roku.
This commit is contained in:
@@ -35,6 +35,7 @@ export const BROWSER_ALIASES_MAP = {
|
||||
'WebOS Browser': 'webos',
|
||||
WeChat: 'wechat',
|
||||
'Yandex Browser': 'yandex',
|
||||
Roku: 'roku',
|
||||
};
|
||||
|
||||
export const BROWSER_MAP = {
|
||||
@@ -94,6 +95,7 @@ export const OS_MAP = {
|
||||
Linux: 'Linux',
|
||||
ChromeOS: 'Chrome OS',
|
||||
PlayStation4: 'PlayStation 4',
|
||||
Roku: 'Roku',
|
||||
};
|
||||
|
||||
export const ENGINE_MAP = {
|
||||
|
||||
@@ -2,6 +2,18 @@ import Utils from './utils.js';
|
||||
import { OS_MAP } from './constants.js';
|
||||
|
||||
export default [
|
||||
/* Roku */
|
||||
{
|
||||
test: [/Roku\/DVP/],
|
||||
describe(ua) {
|
||||
const version = Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, ua);
|
||||
return {
|
||||
name: OS_MAP.Roku,
|
||||
version,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
/* Windows Phone */
|
||||
{
|
||||
test: [/windows phone/i],
|
||||
|
||||
@@ -239,4 +239,16 @@ export default [
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
/* Roku */
|
||||
{
|
||||
test(parser) {
|
||||
return parser.getOSName(true) === 'roku';
|
||||
},
|
||||
describe() {
|
||||
return {
|
||||
type: PLATFORMS_MAP.tv,
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user