mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
[PM-3677] Remove ipcRenderer from desktop utils (#6477)
* [PM-3677] Remove ipcRenderer from utils * Fix typo
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { ipcRenderer } from "electron";
|
||||
|
||||
export type RendererMenuItem = {
|
||||
label?: string;
|
||||
type?: "normal" | "separator" | "submenu" | "checkbox" | "radio";
|
||||
@@ -10,7 +8,7 @@ export function invokeMenu(menu: RendererMenuItem[]) {
|
||||
const menuWithoutClick = menu.map((m) => {
|
||||
return { label: m.label, type: m.type };
|
||||
});
|
||||
ipcRenderer.invoke("openContextMenu", { menu: menuWithoutClick }).then((i: number) => {
|
||||
ipc.platform.openContextMenu(menuWithoutClick).then((i: number) => {
|
||||
if (i !== -1) {
|
||||
menu[i].click();
|
||||
}
|
||||
@@ -82,7 +80,3 @@ 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