mirror of
https://github.com/DeNNiiInc/Web-Page-Performance-Test.git
synced 2026-04-18 04:05:58 +00:00
Add debug script
This commit is contained in:
26
debug-chrome.js
Normal file
26
debug-chrome.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
const chromeLauncher = require('chrome-launcher');
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
console.log('Attempting to launch Chrome directly...');
|
||||||
|
const chromePath = '/usr/bin/chromium';
|
||||||
|
console.log(`Using path: ${chromePath}`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const chrome = await chromeLauncher.launch({
|
||||||
|
chromeFlags: ['--headless', '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'],
|
||||||
|
chromePath: chromePath
|
||||||
|
});
|
||||||
|
console.log('SUCCESS: Chrome launched!');
|
||||||
|
console.log('Port:', chrome.port);
|
||||||
|
console.log('PID:', chrome.pid);
|
||||||
|
|
||||||
|
setTimeout(async () => {
|
||||||
|
await chrome.kill();
|
||||||
|
console.log('Chrome killed. Exiting.');
|
||||||
|
}, 2000);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('FAILURE: Chrome failed to launch.');
|
||||||
|
console.error(e);
|
||||||
|
console.error(JSON.stringify(e, null, 2));
|
||||||
|
}
|
||||||
|
})();
|
||||||
Reference in New Issue
Block a user