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:
@@ -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",
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user