Rebuild AgentCompany Electron app
This commit is contained in:
1 parent
bc5daa6eb8
commit
fcf6d90731
56 files changed
+8667
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import type { BrowserWindow } from "electron";
|
||||
|
||||
export function attachMainWindowSecurity(win: BrowserWindow, devServerOrigin: string | null): void {
|
||||
win.webContents.setWindowOpenHandler(() => ({ action: "deny" }));
|
||||
win.webContents.on("will-navigate", (event, url) => {
|
||||
if (devServerOrigin && url.startsWith(devServerOrigin)) return;
|
||||
if (url.startsWith("file://")) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user