1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00

feat(DuckDuckGo): [PM-9388] Add new device type for DuckDuckGo browser

* Add new device type for DuckDuckGo browser

* Added feature support property for sync domains

* Added new features

* Added isDuckDuckGo() to CLI

* Addressed PR feedback.

* Renamed new property

* Fixed rename that missed CLI.
This commit is contained in:
Todd Martin
2025-07-03 11:27:28 -04:00
committed by GitHub
parent 522acf5718
commit d1c6b334b1
11 changed files with 150 additions and 48 deletions

View File

@@ -97,7 +97,7 @@ import { PaymentResponse } from "../billing/models/response/payment.response";
import { PlanResponse } from "../billing/models/response/plan.response";
import { SubscriptionResponse } from "../billing/models/response/subscription.response";
import { TaxInfoResponse } from "../billing/models/response/tax-info.response";
import { DeviceType } from "../enums";
import { ClientType, DeviceType } from "../enums";
import { KeyConnectorUserKeyRequest } from "../key-management/key-connector/models/key-connector-user-key.request";
import { SetKeyConnectorKeyRequest } from "../key-management/key-connector/models/set-key-connector-key.request";
import { VaultTimeoutSettingsService } from "../key-management/vault-timeout";
@@ -154,8 +154,6 @@ export type HttpOperations = {
export class ApiService implements ApiServiceAbstraction {
private device: DeviceType;
private deviceType: string;
private isWebClient = false;
private isDesktopClient = false;
private refreshTokenPromise: Promise<string> | undefined;
/**
@@ -178,22 +176,6 @@ export class ApiService implements ApiServiceAbstraction {
) {
this.device = platformUtilsService.getDevice();
this.deviceType = this.device.toString();
this.isWebClient =
this.device === DeviceType.IEBrowser ||
this.device === DeviceType.ChromeBrowser ||
this.device === DeviceType.EdgeBrowser ||
this.device === DeviceType.FirefoxBrowser ||
this.device === DeviceType.OperaBrowser ||
this.device === DeviceType.SafariBrowser ||
this.device === DeviceType.UnknownBrowser ||
this.device === DeviceType.VivaldiBrowser;
this.isDesktopClient =
this.device === DeviceType.WindowsDesktop ||
this.device === DeviceType.MacOsDesktop ||
this.device === DeviceType.LinuxDesktop ||
this.device === DeviceType.WindowsCLI ||
this.device === DeviceType.MacOsCLI ||
this.device === DeviceType.LinuxCLI;
}
// Auth APIs
@@ -838,7 +820,9 @@ export class ApiService implements ApiServiceAbstraction {
// Sync APIs
async getSync(): Promise<SyncResponse> {
const path = this.isDesktopClient || this.isWebClient ? "/sync?excludeDomains=true" : "/sync";
const path = !this.platformUtilsService.supportsAutofill()
? "/sync?excludeDomains=true"
: "/sync";
const r = await this.send("GET", path, null, true, true);
return new SyncResponse(r);
}
@@ -1875,7 +1859,7 @@ export class ApiService implements ApiServiceAbstraction {
private async getCredentials(): Promise<RequestCredentials> {
const env = await firstValueFrom(this.environmentService.environment$);
if (!this.isWebClient || env.hasBaseUrl()) {
if (this.platformUtilsService.getClientType() !== ClientType.Web || env.hasBaseUrl()) {
return "include";
}
return undefined;