In our Sourcegraph clients that aren't served from the same origin as the API (browser extension, VS Code extension), we make requests from the background and forward responses to the client in order to get around CORS restrictions (#5517). This adds a lot of complexity to the architecture, making it difficult for newcomers to contribute.
In the browser extension, background is the background page and client is the content script.
In the VS Code extension, background is the extension (running in extension host node process) and client is the webview.
In our Sourcegraph clients that aren't served from the same origin as the API (browser extension, VS Code extension), we make requests from the background and forward responses to the client in order to get around CORS restrictions (#5517). This adds a lot of complexity to the architecture, making it difficult for newcomers to contribute.
In the browser extension, background is the background page and client is the content script.
In the VS Code extension, background is the extension (running in extension host node process) and client is the webview.