mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 19:23:52 +00:00
[PM-3756] Disable node integration and enable context isolation in desktop (#6975)
* Disable node integration and enable context isolation * Review comments * Log in renderer through IPC * Missed imports * Mock electron API * resourcesPath is undefined in the preload, but process.windowsStore works correctly * Replace fromBufferToUtf8 conditional implementation for the `buffer` package The current non-node implementation is different than the node implementation, as the non-node would break when the contents can't be parsed as a URI component. Replacing the impl by the `buffer` package makes the result match in both environments. * Fix lint * Add some more tests * Remove buffer from devDependencies
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
import { enableProdMode } from "@angular/core";
|
||||
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
|
||||
|
||||
import { ipc } from "../preload";
|
||||
import { isDev } from "../utils";
|
||||
|
||||
// Temporary polyfill for preload script
|
||||
(window as any).ipc = ipc;
|
||||
|
||||
require("../scss/styles.scss");
|
||||
require("../scss/tailwind.css");
|
||||
|
||||
import { AppModule } from "./app.module";
|
||||
|
||||
if (!isDev()) {
|
||||
if (!ipc.platform.isDev) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user