1
Fork 0
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-07-23 20:45:17 -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')`) }
}
}