Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This pull request replaces Electron with Puppeteer for headless browser automation in the Matrix-Google Voice bridge. The key motivation for this change is to reduce resource usage and simplify deployment, especially in containerized environments.
Key Changes:
Browser Initialization:
Replaced Electron-based initialization with Puppeteer.
Puppeteer now handles launching a headless browser to interact with Google Voice.
Script Injection:
Script loading previously done via webContents in Electron is now handled with page.addScriptTag() in Puppeteer.
Request Interception:
Network request interception logic has been moved to Puppeteer’s page.on('request', ...) to block unnecessary requests and allow only essential ones.
JavaScript Execution:
Replaced Electron’s webContents.executeJavaScript() with Puppeteer’s page.evaluate() to execute custom scripts within the browser context.
Inter-Process Communication (IPC):
Retained the same IPC mechanism (stdin and stdout) for communication between the Go application and the headless browser, ensuring backward compatibility.
File Renaming:
Benefits:
Reduced Overhead: Puppeteer is lighter than Electron, leading to lower resource usage.
Easier Containerization: Puppeteer integrates better with containers, eliminating the need for Electron’s GUI components.
More Streamlined Dependencies: Fewer dependencies are required compared to Electron.
Testing:
Successfully tested all major functionalities, including:
Browser initialization
Script injection
Request interception
JavaScript execution
IPC communication