mirror of https://github.com/jiahaog/Nativefier
23 lines
442 B
TypeScript
23 lines
442 B
TypeScript
import { inferUserAgent } from '../../infer/inferUserAgent';
|
|
|
|
type UserAgentOpts = {
|
|
packager: {
|
|
electronVersion?: string;
|
|
platform?: string;
|
|
};
|
|
nativefier: {
|
|
userAgent?: string;
|
|
};
|
|
};
|
|
|
|
export async function userAgent(options: UserAgentOpts): Promise<string> {
|
|
if (options.nativefier.userAgent) {
|
|
return null;
|
|
}
|
|
|
|
return inferUserAgent(
|
|
options.packager.electronVersion,
|
|
options.packager.platform,
|
|
);
|
|
}
|