mirror of
https://github.com/bitwarden/browser
synced 2026-02-01 09:13:54 +00:00
User agent
This commit is contained in:
@@ -329,6 +329,10 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic
|
||||
return autofillCommand;
|
||||
}
|
||||
|
||||
userAgentPart(): Promise<string> {
|
||||
return Promise.resolve("");
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers the offscreen document API to copy the text to the clipboard.
|
||||
*/
|
||||
|
||||
@@ -152,4 +152,8 @@ export class CliPlatformUtilsService implements PlatformUtilsService {
|
||||
getAutofillKeyboardShortcut(): Promise<string> {
|
||||
return null;
|
||||
}
|
||||
|
||||
userAgentPart(): Promise<string> {
|
||||
return Promise.resolve("");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,6 +185,10 @@ export class WindowMain {
|
||||
|
||||
await this.createWindow();
|
||||
resolve();
|
||||
|
||||
const userAgent = this.win.webContents.session.getUserAgent();
|
||||
this.logService.info(`Loaded URL with user agent: ${userAgent}`);
|
||||
|
||||
if (this.argvCallback != null) {
|
||||
this.argvCallback(process.argv);
|
||||
}
|
||||
|
||||
@@ -151,4 +151,20 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
|
||||
getAutofillKeyboardShortcut(): Promise<string> {
|
||||
return null;
|
||||
}
|
||||
|
||||
async userAgentPart(): Promise<string> {
|
||||
let packageType = "Unsandboxed";
|
||||
if (ipc.platform.isMacAppStore) {
|
||||
packageType = "MacAppStore";
|
||||
} else if (ipc.platform.isWindowsStore) {
|
||||
packageType = "WindowsStore";
|
||||
} else if (ipc.platform.isAppImage) {
|
||||
packageType = "AppImage";
|
||||
} else if (ipc.platform.isSnapStore) {
|
||||
packageType = "Snap";
|
||||
} else if (ipc.platform.isFlatpak) {
|
||||
packageType = "Flatpak";
|
||||
}
|
||||
return `Bitwarden-Desktop/${await this.getApplicationVersion()} (${packageType})`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,4 +219,8 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
||||
getAutofillKeyboardShortcut(): Promise<string> {
|
||||
return null;
|
||||
}
|
||||
|
||||
userAgentPart(): Promise<string> {
|
||||
return Promise.resolve("");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,4 +55,5 @@ export abstract class PlatformUtilsService {
|
||||
abstract readFromClipboard(): Promise<string>;
|
||||
abstract supportsSecureStorage(): boolean;
|
||||
abstract getAutofillKeyboardShortcut(): Promise<string>;
|
||||
abstract userAgentPart(): Promise<string>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user