mirror of
https://github.com/mileswolfallen2/gelectron.git
synced 2026-12-06 08:43:52 +00:00
- Created main.js for the application logic, including tests for Electron app properties and methods. - Added package.json to define app metadata. - Included necessary code signature files for macOS app distribution. - Implemented basic window management and event handling in the app.
26 lines
537 B
JavaScript
26 lines
537 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Gelectron - webContents utilities (Electron compatible)
|
|
*/
|
|
|
|
const { BrowserWindow } = require('./browser-window');
|
|
|
|
const webContents = {
|
|
getAllWebContents() {
|
|
return BrowserWindow.getAllWindows().map((win) => win.webContents);
|
|
},
|
|
|
|
getFocusedWebContents() {
|
|
const focused = BrowserWindow.getFocusedWindow();
|
|
return focused ? focused.webContents : null;
|
|
},
|
|
|
|
fromId(id) {
|
|
const win = BrowserWindow.fromId(id);
|
|
return win ? win.webContents : null;
|
|
},
|
|
};
|
|
|
|
module.exports = webContents;
|