1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PS-526] Allow loading captcha cookie on desktop (#811)

* update icons for universal access

* add util function to check cookies from main process

* Make linter happy

Co-authored-by: Daniel James Smith <djsmith@web.de>
This commit is contained in:
Jake Fink
2022-06-02 06:02:22 -04:00
committed by GitHub
parent 2b647df001
commit f4066b4f58
7 changed files with 18 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { app, dialog, ipcMain, Menu, MenuItem, nativeTheme } from "electron";
import { app, dialog, ipcMain, Menu, MenuItem, nativeTheme, session } from "electron";
import { MessagingService } from "jslib-common/abstractions/messaging.service";
import { ThemeType } from "jslib-common/enums/themeType";
@@ -47,6 +47,10 @@ export class ElectronMainMessagingService implements MessagingService {
return windowMain.win?.isVisible();
});
ipcMain.handle("getCookie", async (event, options) => {
return await session.defaultSession.cookies.get(options);
});
nativeTheme.on("updated", () => {
windowMain.win?.webContents.send(
"systemThemeUpdated",

View File

@@ -74,3 +74,7 @@ export function cleanUserAgent(userAgent: string): string {
.replace(userAgentItem("Bitwarden", " "), "")
.replace(userAgentItem("Electron", " "), "");
}
export async function getCookie(url: string, name: string): Promise<Electron.Cookie[]> {
return await ipcRenderer.invoke("getCookie", { url: url, name: name });
}