I guess the main idea behind your question is how to communicate between a Chrome extension and a native app. There are several ways to do that, depending on your specific requirements and constraints. Here are some of the most common options:
Native messaging: This is a built-in feature in Chrome that allows you to send messages between the extension and a native app using a JSON-based protocol. The native app needs to register a manifest file with Chrome, and the extension needs to send messages to a specified host and port. Native messaging can be secure and reliable, but it requires some setup and development effort.
WebSocket: You can use a WebSocket to establish a bi-directional connection between the extension and the native app. The WebSocket can be opened from either side, and messages can be sent and received in real-time. WebSocket communication can be fast and efficient, but it requires more setup and may not be as secure as native messaging.
HTTP REST API: You can expose a REST API from the native app, and the extension can make HTTP requests to this API to exchange data. This approach is widely used and can be easy to implement, but it may not be as fast or efficient as native messaging or WebSocket.
Shared memory: You can create a shared memory buffer that both the extension and the native app can access, and use this buffer to exchange data. This approach can be very fast and efficient, but it requires careful management of the shared memory to avoid synchronization issues and security vulnerabilities.
Ultimately, the best way to communicate between a Chrome extension and a native app depends on your specific requirements. You should consider factors such as performance, security, ease of implementation, and compatibility with existing systems when choosing a communication method.
I am not a big fan of (2) and (4) so we are left with (1) and (3), the advantage of (3) is the native app need not be on the same host. Advantage of (1) is I guess is it's what google officially recommends and hence puts in all effort to make it full proof and secure. So if you are doing it for the first time go with (1).
But in long run if you want a simpler and more straightforward approach, HTTP REST API might win on the ease of implementation parameter.