[Part 2 for #issues/27922] Add browser extension support for cloud private repositories
Created by: erzhtor
Closes https://github.com/sourcegraph/sourcegraph/issues/27922. Blocked by https://github.com/sourcegraph/sourcegraph/pull/28387.
Description
This PR:
- Adds back (secure) support for private repositories on Sourcegraph Cloud
Note: as a positive side-effects:
- browser extension does not override GitHub native tooltips when the repository is not cloned on Cloud
- browser extension is immediately reinitialized on all open/active pages when Sourcegraph URL changes
How to test
sg run bext
- Set the extension to cloud URL (https://sourcegraph.com)
- Open any public repo and make sure the browser extension works properly
- Open any private repo which is cloned in Cloud and make sure the browser extension works properly
- Open any private repo which is NOT cloned in Cloud and make sure the browser extension does NOT work and does not make any requests except
SecureCheckRepoCloned
in extension background script -> Network tab
- Set the extension to a self-hosted URL (https://k8s.sgdev.org)
- Make that browser extension works as previously