@lightcone-ai/daemon 0.9.57 → 0.9.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -120,11 +120,13 @@ async function _spawnChrome(profileDir, port) {
|
|
|
120
120
|
}
|
|
121
121
|
} catch {}
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
// On macOS with a display, run non-headless for best site compatibility
|
|
124
|
+
// (headless Chrome has detectable fingerprints that some sites block)
|
|
125
|
+
const isHeadless = process.platform !== 'darwin' || !!process.env.FORCE_HEADLESS;
|
|
126
|
+
const chromeArgs = [
|
|
124
127
|
`--remote-debugging-port=${port}`,
|
|
125
128
|
'--no-sandbox',
|
|
126
129
|
'--disable-dev-shm-usage',
|
|
127
|
-
'--headless=new',
|
|
128
130
|
`--user-data-dir=${profileDir}`,
|
|
129
131
|
'--window-size=1280,900',
|
|
130
132
|
'--disable-blink-features=AutomationControlled',
|
|
@@ -135,10 +137,13 @@ async function _spawnChrome(profileDir, port) {
|
|
|
135
137
|
'--disable-hang-monitor',
|
|
136
138
|
'--use-mock-keychain',
|
|
137
139
|
'--password-store=basic',
|
|
138
|
-
'--disable-gpu',
|
|
139
140
|
'--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
|
140
141
|
'about:blank',
|
|
141
|
-
]
|
|
142
|
+
];
|
|
143
|
+
if (isHeadless) {
|
|
144
|
+
chromeArgs.splice(3, 0, '--headless=new', '--disable-gpu');
|
|
145
|
+
}
|
|
146
|
+
const proc = spawn(CHROME_BIN, chromeArgs, { stdio: 'ignore', detached: false });
|
|
142
147
|
|
|
143
148
|
proc.on('error', (err) => {
|
|
144
149
|
console.error(`[ChromePool] Spawn error: ${err.message}`);
|