diff --git a/source/browser.ts b/source/browser.ts index 6bfabe18e..233e2654e 100644 --- a/source/browser.ts +++ b/source/browser.ts @@ -55,7 +55,6 @@ async function withSettingsMenu(callback: () => Promise | void): Promise { let selector; diff --git a/source/index.ts b/source/index.ts index 8fd5bff50..40a566866 100644 --- a/source/index.ts +++ b/source/index.ts @@ -107,8 +107,10 @@ electronContextMenu({ // Only show it when right-clicking an image visible: parameters.mediaType === 'image', click: () => { + const imgURL = parameters.srcURL; + const imgTitle = imgURL.substring(imgURL.lastIndexOf('/') + 1); const imgWin = new BrowserWindow({ - title: 'New Window', + title: imgTitle, useContentSize: true, darkTheme: darkMode.isEnabled, webPreferences: { @@ -116,9 +118,8 @@ electronContextMenu({ nodeIntegrationInWorker: false, experimentalFeatures: true, devTools: true, - }, + }, }); - const imgURL = parameters.srcURL; imgWin.loadURL(imgURL); }, }, @@ -127,8 +128,8 @@ electronContextMenu({ // Only show it when right-clicking video visible: parameters.mediaType === 'video', click: () => { - const vidURL = parameters.srcURL; - const vidTitle = vidURL.substring(vidURL.lastIndexOf('/') + 1); + const vidURL = parameters.srcURL; + const vidTitle = vidURL.substring(vidURL.lastIndexOf('/') + 1); const vidWin = new BrowserWindow({ title: vidTitle, width: 1024, diff --git a/source/menu.ts b/source/menu.ts index 3dfef175b..346b86ce9 100644 --- a/source/menu.ts +++ b/source/menu.ts @@ -750,7 +750,7 @@ ${debugInfo()}`; click() { const verWindow = new BrowserWindow({ width: 280, - height: 174, + height: 190, useContentSize: true, autoHideMenuBar: true, maximizable: false, diff --git a/static/preload.js b/static/preload.js index 5923b9d93..2b861a288 100644 --- a/static/preload.js +++ b/static/preload.js @@ -1,5 +1,11 @@ +const Os = require('os'); const remote = require('@electron/remote'); +// Globally export what OS we are on +const isLinux = process.platform === 'linux'; +const isWin = process.platform === 'win32'; +const isMac = process.platform === 'darwin'; + // Show version numbers of bundled Electron. window.addEventListener('DOMContentLoaded', () => { const replaceText = (selector, text) => { @@ -14,12 +20,25 @@ window.addEventListener('DOMContentLoaded', () => { // Get app version from package.json const appVersion = remote.app.getVersion(); +let osType; +if (isLinux) { + osType = 'Linux'; +} else if (isWin) { + osType = 'Win'; +} else if (isMac) { + osType = 'MacOS'; +} else { + osType = 'BSD'; +} +const archType = Os.arch(); + // Show app version in about.html window.addEventListener('DOMContentLoaded', () => { const replaceText = (selector, text) => { const element = document.getElementById(selector); if (element) element.innerText = text }; - replaceText('caprine-version', appVersion); + replaceText('os-type', osType); + replaceText('arch-type', archType); }); diff --git a/static/versions.html b/static/versions.html index 1f09ac6fd..67a1237b3 100644 --- a/static/versions.html +++ b/static/versions.html @@ -36,8 +36,17 @@

- Caprine: v
- Electron
Chromium
Node.js
V8 + Caprine: v +
+ Electron +
+ Chromium +
+ Node.js +
+ V8 +
+ OS Type 

Copyright © 2024 by Alex313031