mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove string replaceAll implementations
This commit is contained in:
parent
b008f2db30
commit
8536fe4610
6 changed files with 8 additions and 38 deletions
|
@ -63,23 +63,13 @@ function getDeviceProfile(item) {
|
|||
});
|
||||
}
|
||||
|
||||
function escapeRegExp(str) {
|
||||
return str.replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1');
|
||||
}
|
||||
|
||||
function replaceAll(originalString, strReplace, strWith) {
|
||||
const strReplace2 = escapeRegExp(strReplace);
|
||||
const reg = new RegExp(strReplace2, 'ig');
|
||||
return originalString.replace(reg, strWith);
|
||||
}
|
||||
|
||||
function generateDeviceId() {
|
||||
const keys = [];
|
||||
|
||||
keys.push(navigator.userAgent);
|
||||
keys.push(new Date().getTime());
|
||||
if (window.btoa) {
|
||||
return replaceAll(btoa(keys.join('|')), '=', '1');
|
||||
return btoa(keys.join('|')).replaceAll('=', '1');
|
||||
}
|
||||
|
||||
return new Date().getTime();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue