Files
orca/src/shared/browser-cookie-import-sources.ts
T
dojinekoandNeil 85ea1cc4c5 feat(browser): add Vivaldi as a Chromium cookie-import source (#11449)
Detect Vivaldi profiles on macOS, Windows, and Linux and import their
cookies like other Chromium browsers. On Linux, Vivaldi stores its
cookie key under Chrome's libsecret application name, so the browser
definition can override the keyring application used for the lookup.

Co-authored-by: Neil <neil@stably.ai>
2026-10-28 01:28:04 -07:00

32 lines
1.1 KiB
TypeScript

/** Human-readable import sources aligned with CHROMIUM_BROWSERS in
* browser-cookie-import.ts plus Firefox/Safari detection. */
const CHROMIUM_COOKIE_IMPORT_SOURCES = [
{ label: 'Google Chrome', mac: true, win: true, linux: true },
{ label: 'Microsoft Edge', mac: true, win: true, linux: true },
{ label: 'Arc', mac: true, win: false, linux: false },
{ label: 'Brave', mac: true, win: true, linux: true },
{ label: 'Comet', mac: true, win: true, linux: false },
{ label: 'Helium', mac: true, win: false, linux: false },
{ label: 'Vivaldi', mac: true, win: true, linux: true }
] as const
export function getBrowserCookieImportSourceLabels(
platform: 'darwin' | 'win32' | 'linux'
): string[] {
const labels: string[] = []
for (const source of CHROMIUM_COOKIE_IMPORT_SOURCES) {
if (platform === 'darwin' && source.mac) {
labels.push(source.label)
} else if (platform === 'win32' && source.win) {
labels.push(source.label)
} else if (platform === 'linux' && source.linux) {
labels.push(source.label)
}
}
labels.push('Firefox')
if (platform === 'darwin') {
labels.push('Safari')
}
return labels
}