Skip to content

Add WebSocket connection and message handling#171

Open
Nanotrejo wants to merge 8 commits intoneutralinojs:mainfrom
Nanotrejo:main
Open

Add WebSocket connection and message handling#171
Nanotrejo wants to merge 8 commits intoneutralinojs:mainfrom
Nanotrejo:main

Conversation

@Nanotrejo
Copy link
Copy Markdown

This pull request refactors and improves the WebSocket connection logic in src/ws/websocket.ts, with a focus on supporting both HTTP and HTTPS protocols, improving code readability, and applying consistent formatting and minor bug fixes. The most important changes are grouped below:

WebSocket Protocol and Port Handling:

  • Introduced a new getWebSocketConfig function to dynamically determine the correct WebSocket protocol (ws or wss) and port based on the application's environment and how it is accessed (HTTP, HTTPS, or local development). The init function now uses this configuration to construct the WebSocket URL, enabling secure connections when needed.

Bug Fixes and Minor Improvements:

  • Fixed a missing semicolon in the initialization of extensionMessageQueue.
  • Improved error handling and messaging for invalid tokens and connection errors, ensuring error messages are displayed more clearly to the user.
  • Updated the UUID generation function for clarity and consistency.Implements error handling for token and connection issues.

Nanotrejo and others added 8 commits December 4, 2025 17:32
Initializes WebSocket connection with dynamic protocol/port config.
Adds functions to send and queue messages, and handle events.
Implements error handling for token and connection issues.
Co-authored-by: Nanotrejo <43764924+Nanotrejo@users.noreply.github.com>
Updates the window zoom message to use 'zoom' as the parameter name for the zoom factor, aligning it with expected conventions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants