Skip to content

Commit

Permalink
disable navigation actions, closes #487
Browse files Browse the repository at this point in the history
* Via resetting the navigation history in "did-navigate-in-page" even handler.
  • Loading branch information
vladimiry committed Feb 16, 2022
1 parent e6ff026 commit 85255aa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/electron-main/window/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,15 @@ export async function initMainBrowserWindow(ctx: Context): Promise<BrowserWindow

await browserWindow.loadURL(ctx.locations.browserWindowPage);

const {webContents} = browserWindow;

webContents.on("did-navigate-in-page", () => {
webContents.clearHistory();
});

if (BUILD_ENVIRONMENT === "development") {
browserWindow.webContents.openDevTools(/* {mode: "detach"} */);
webContents.openDevTools(/* {mode: "detach"} */);
}

return browserWindow;
}

0 comments on commit 85255aa

Please sign in to comment.