Files
gelectron/GeelectronDemo-darwin-arm64/GeelectronDemo.app/Contents/MacOS/compat/web-contents.js
T
miles e5d93b3613 Add initial implementation of GeelectronDemo app
- 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.
2026-07-27 23:56:34 -05:00

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;