From 7eae250c2a085984a7e1bd86b0b43fb5884673b5 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Sun, 26 Jun 2022 14:05:49 -0700 Subject: [PATCH] Fix OSFMount link --- src/main/windows.ts | 18 ++++++++++++++++-- src/renderer/card-drive.tsx | 10 ++++++++-- src/renderer/card-settings.tsx | 9 ++++----- src/renderer/emulator.tsx | 1 - 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/main/windows.ts b/src/main/windows.ts index 8f69921..5bafd38 100644 --- a/src/main/windows.ts +++ b/src/main/windows.ts @@ -1,4 +1,4 @@ -import { BrowserWindow } from "electron"; +import { BrowserWindow, shell } from "electron"; let mainWindow: BrowserWindow | null = null; @@ -20,10 +20,24 @@ export function getOrCreateWindow(): BrowserWindow { // mainWindow.webContents.toggleDevTools(); mainWindow.loadFile("./dist/static/index.html"); - + + mainWindow.webContents.on("will-navigate", (event, url) => + handleNavigation(event, url) + ); + mainWindow.webContents.on("new-window", (event, url) => + handleNavigation(event, url) + ); + mainWindow.on("closed", () => { mainWindow = null; }); return mainWindow; } + +function handleNavigation(event: Electron.Event, url: string) { + if (url.startsWith("http")) { + event.preventDefault(); + shell.openExternal(url); + } +} diff --git a/src/renderer/card-drive.tsx b/src/renderer/card-drive.tsx index c18b178..8c927a7 100644 --- a/src/renderer/card-drive.tsx +++ b/src/renderer/card-drive.tsx @@ -53,8 +53,14 @@ export class CardDrive extends React.Component {

Windows 10 cannot mount raw disk images (ironically, macOS and Linux can). However, tools exist that let you mount this drive, like the - freeware tool OSFMount. I am not - affiliated with it, so please use it at your own risk. + freeware tool{" "} + + OSFMount + + . I am not affiliated with it, so please use it at your own risk.

{this.renderMountButton("Windows Explorer")} diff --git a/src/renderer/card-settings.tsx b/src/renderer/card-settings.tsx index 51982cd..1b8ce11 100644 --- a/src/renderer/card-settings.tsx +++ b/src/renderer/card-settings.tsx @@ -72,12 +72,11 @@ export class CardSettings extends React.Component< style={{ display: "none" }} />

- windows95 comes with a virtual CD drive. It can mount images in the "iso" format. + windows95 comes with a virtual CD drive. It can mount images in the + "iso" format.

- {cdrom - ? `Inserted CD: ${cdrom.path}` - : `No CD mounted`} + {cdrom ? `Inserted CD: ${cdrom?.path}` : `No CD mounted`}