fix: prevent macOS backend Dock registration
Preload a backend-only JS title accessor from an unpacked macOS resource before Next starts. Preserve Windows and Linux launch arguments, and test title semantics, process scope, argument order, and resource copying. Based on the prevention approach proposed by marchellodev in PR #47.
This commit is contained in:
+5
-1
@@ -196,7 +196,11 @@ function startServer(port) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const child = spawn(
|
||||
process.execPath,
|
||||
[serverEntry()],
|
||||
// Only the macOS backend needs this: Next's native title setter
|
||||
// otherwise checks this Node-mode process in as a foreground app.
|
||||
process.platform === "darwin"
|
||||
? ["--require", path.join(process.resourcesPath, "server-title-guard.cjs"), serverEntry()]
|
||||
: [serverEntry()],
|
||||
{
|
||||
cwd: path.dirname(serverEntry()),
|
||||
env: {
|
||||
|
||||
Reference in New Issue
Block a user