This repository has been archived on 2025-04-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
FalixNodes-Desktop-NP/electron/platform.js
2025-03-22 22:04:43 -04:00

14 lines
No EOL
1.1 KiB
JavaScript
Executable file

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')`) }
}
}