chore: restructure project and add i18n support
- Reorganize project structure with new electron and shared directories - Add comprehensive i18n support with Chinese, English, and Japanese locales - Update build configurations and TypeScript paths for new structure - Add various UI components including chat interface and task management - Include Windows release binaries and localization files - Update dependencies and fix import paths throughout the codebase
This commit is contained in:
21
electron/utils/chrome/isChromeRunning.ts
Normal file
21
electron/utils/chrome/isChromeRunning.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import http from 'http';
|
||||
|
||||
// Chrome是否已运行
|
||||
export async function isChromeRunning(): Promise<boolean> {
|
||||
try {
|
||||
return new Promise((resolve) => {
|
||||
const req = http.get('http://127.0.0.1:9222/json/version', (res: any) => {
|
||||
resolve(res.statusCode === 200);
|
||||
});
|
||||
|
||||
req.on('error', () => resolve(false));
|
||||
|
||||
req.setTimeout(1000, () => {
|
||||
req.destroy();
|
||||
resolve(false);
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user