diff --git a/README.md b/README.md index c1d83b1..33a39d9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ An electron app to log into Google Calendar. ## Rationale -As of this application's first release, there is no desktop tool to interact with Google Calendar, Tasks, and Notes with a UI consistent with the web application. +As of this writing (January 2024), there is no desktop tool to interact with Google Calendar, Tasks, and Notes with a UI consistent with the web application. ## Notes * Executables for macOS and Linux are created on pushes to the `main` branch or pull requests to `main`. They are stored as _GitHub Actions Artifacts_ for one day. @@ -13,4 +13,4 @@ The project is made with electron-forge and node.js 18 1. Clone repo. 2. Run `npm i` in the project codebase. 3. Run `npm run start` to start the application in development mode (local storage location is printed to console in case you want to clear it later). -4. Run `npm run package` to create an executable for the current platform. \ No newline at end of file +4. Run `npm run package` to create an executable for the current platform. diff --git a/main.cjs b/main.cjs index c41d528..638dd32 100644 --- a/main.cjs +++ b/main.cjs @@ -9,12 +9,20 @@ const createWindow = () => { icon: 'resources/material_apps.png', }); + // Same behaviour as win.webContents.loadURL(...) win.loadURL(config.appUrl); win.once('ready-to-show', () => { win.setTitle(config.title); win.show() }) + + // Load contents of new windows in main window instead. + // Avoids desktop clutter + win.webContents.setWindowOpenHandler((details) => { + win.loadURL(details.url); + return {action: 'deny'}; + }) } app.whenReady().then(() => {