mirror of
https://github.com/bitwarden/browser
synced 2026-01-06 10:33:57 +00:00
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { ipcMain } from "electron";
|
|
|
|
import { chromium_importer } from "@bitwarden/desktop-napi";
|
|
|
|
import { isMacAppStore } from "../../../utils";
|
|
|
|
export class ChromiumImporterService {
|
|
constructor() {
|
|
ipcMain.handle("chromium_importer.getMetadata", async (event, isMas: boolean) => {
|
|
return await chromium_importer.getMetadata(isMas);
|
|
});
|
|
|
|
// Used on Mac OS App Store builds to request permissions to browser entries outside the sandbox
|
|
ipcMain.handle("chromium_importer.requestBrowserAccess", async (event, browser: string) => {
|
|
return await chromium_importer.requestBrowserAccess(browser, isMacAppStore());
|
|
});
|
|
|
|
ipcMain.handle("chromium_importer.getAvailableProfiles", async (event, browser: string) => {
|
|
return await chromium_importer.getAvailableProfiles(browser, isMacAppStore());
|
|
});
|
|
|
|
ipcMain.handle(
|
|
"chromium_importer.importLogins",
|
|
async (event, browser: string, profileId: string) => {
|
|
return await chromium_importer.importLogins(browser, profileId, isMacAppStore());
|
|
},
|
|
);
|
|
}
|
|
}
|