Update main.js

This commit is contained in:
Anirudh Sevugan 2025-02-28 00:09:37 +05:30 committed by GitHub
parent cc64b6969f
commit 75e388cffa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -181,6 +181,17 @@ function unregisterShortcuts() {
console.log("Shortcuts unregistered");
}
function isValidFileArg(arg) {
return (
typeof arg === "string" &&
!arg.startsWith("-") && // Exclude Electron flags
!arg.includes("electron") && // Exclude internal Electron args
!arg.endsWith(".app") && // Exclude the app itself on macOS
!arg.endsWith("/Contents/MacOS/AppName") // Exclude macOS internal launch paths
);
}
app.whenReady().then(() => {
createWindow();
setupMenu();