Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/plugins/default-browser-emulator/lib/helpers/configureDeviceProfile.ts
1030 views
1
import IDeviceProfile from '@secret-agent/interfaces/IDeviceProfile';
2
import { randomBytes } from 'crypto';
3
4
export default function configureDeviceProfile(deviceProfile: IDeviceProfile): void {
5
deviceProfile.deviceMemory ??= Math.ceil(Math.random() * 4) * 2;
6
deviceProfile.videoDevice ??= {
7
deviceId: randomBytes(32).toString('hex'),
8
groupId: randomBytes(32).toString('hex'),
9
};
10
deviceProfile.webGlParameters ??= {
11
// UNMASKED_VENDOR_WEBGL
12
37445: 'Intel Inc.',
13
// UNMASKED_RENDERER_WEBGL
14
37446: 'Intel Iris OpenGL Engine',
15
};
16
}
17
18