Skip to content

Commit 4f33698

Browse files
PascalThuetclaude
andcommitted
chore: remove ua-parser-js — use core Utils.parseUserAgent instead
ua-parser-js was replaced in src/ by a lightweight browser detection in Dash-Industry-Forum#4972 but the dependency itself was not removed. The only remaining active usage was in test/functional/src/Utils.js, which now uses CoreUtils.parseUserAgent() from src/core/Utils.js. Also removes commented-out ua-parser-js imports in the Capabilities unit test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d4afee5 commit 4f33698

4 files changed

Lines changed: 2 additions & 106 deletions

File tree

package-lock.json

Lines changed: 0 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
"typescript": "^5.9.3",
8686
"webpack": "5.94.0",
8787
"webpack-cli": "^6.0.1",
88-
"ua-parser-js": "^2.0.6",
8988
"webpack-dev-server": "^5.2.2",
9089
"webpack-merge": "^6.0.1",
9190
"yargs": "^18.0.0"

test/functional/src/Utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {UAParser} from 'ua-parser-js'
1+
import CoreUtils from '../../../src/core/Utils.js'
22

33
class Utils {
44

@@ -58,7 +58,7 @@ class Utils {
5858
return false
5959
}
6060

61-
const userAgent = UAParser(navigator.userAgent.toLowerCase())
61+
const userAgent = CoreUtils.parseUserAgent(navigator.userAgent)
6262
return excludedPlatforms.some((platform) => {
6363
return platform && platform.browser && platform.browser.toLowerCase() === userAgent.browser.name.toLowerCase()
6464
})

test/unit/test/streaming/streaming.utils.Capabilities.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@ import DescriptorType from '../../../../src/dash/vo/DescriptorType.js';
44

55
import {expect} from 'chai';
66
import Constants from '../../../../src/streaming/constants/Constants.js';
7-
//import {UAParser} from 'ua-parser-js';
87

98
let settings;
109
let capabilities;
1110

12-
//const uaString = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase() : '';
13-
//const ua = UAParser(uaString);
14-
15-
// The Media Capabilities API seems to return wrong values on Linux with Firefox. Deactivate some tests for now
16-
//const isLinuxFirefox = ua.browser.name.toLowerCase() === 'firefox' && ua.os.name.toLowerCase().includes('linux');
17-
1811
const enhancementCodecs = ['lvc1'];
1912

2013
let EssentialPropertyThumbNail = new DescriptorType;

0 commit comments

Comments
 (0)