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

14 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-03-30 21:53:16 -04:00
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')`) }
}
}