cozy-games/apps/mnswpr/modules/user/user.js
Ayo 969ebba067 chore: restructure to new cozy-games monorepo
Reviewed-on: https://git.ayo.run/ayo/cozy-games/pulls/1
Co-authored-by: Ayo <ayo@ayco.io>
Co-committed-by: Ayo <ayo@ayco.io>
2026-07-03 13:53:13 +00:00

21 lines
No EOL
431 B
JavaScript

export class UserService {
constructor() {
if (!this.id) {
this.browserId = this.generateId()
}
}
generateId() {
var nav = window.navigator
var screen = window.screen
var guid = nav.mimeTypes.length
guid += nav.userAgent.replace(/\D+/g, '')
guid += nav.plugins.length
guid += screen.height || ''
guid += screen.width || ''
guid += screen.pixelDepth || ''
return guid
}
}