This repository has been archived on 2024-05-27. You can view files and clone it, but cannot push or open issues or pull requests.
Nexus-Polestar/electron/platform.js
2023-03-30 21:53:16 -04:00

14 lines
No EOL
1.1 KiB
JavaScript

module.exports = {
Icon: function() {
// Use the correct icon depending on the operating system
if /* If macOS */ (process.platform === 'darwin') {global.AppIcon = 'public/images/icons/app/macOS.icns' }
else if /* If Windows */ (process.platform === 'win32') {global.AppIcon = 'public/images/icons/app/Windows.png'}
else /* If Linux */ {global.AppIcon = 'public/images/icons/app/Linux.png' }
},
Class: function() {
// Set Platform Class
if /* If macOS */ (process.platform === 'darwin') {mainWindow.webContents.executeJavaScript(`document.querySelector('html').setAttribute('os', 'Mac')`) }
else if /* If Windows */ (process.platform === 'win32') {mainWindow.webContents.executeJavaScript(`document.querySelector('html').setAttribute('os', 'Windows')`) }
else /* If Linux */ {mainWindow.webContents.executeJavaScript(`document.querySelector('html').setAttribute('os', 'Linux')`) }
}
}