A proxy probe in a Chrome extension needs a destination with a predictable response. Use an HTTPS endpoint you control, such as one returning a small JSON object containing the address it observes.

Run the request from an extension context, such as its service worker or extension page, with the endpoint in the manifest’s host permissions:

"host_permissions": ["https://probe.example/*"]

Host permission does not give a content script the same cross-origin privileges. Keep the probe in the extension context rather than assuming an injected script can make the identical request.

async function probe() {
  const controller = new AbortController();
  const timer = setTimeout(() => controller.abort(), 5000);
  try {
    const response = await fetch('https://probe.example/ip', {
      cache: 'no-store',
      signal: controller.signal,
    });
    if (!response.ok) throw new Error(`HTTP ${response.status}`);
    const result = await response.json();
    if (typeof result.ip !== 'string') throw new Error('Bad probe body');
    return result.ip;
  } finally {
    clearTimeout(timer);
  }
}

The hostname is a placeholder. The server and client must agree on the response format and caching policy. Handle rejected requests and malformed responses in the extension’s caller rather than displaying them as a valid exit address.

Name the observation accurately

A successful result establishes that this request reached the endpoint and received the expected form of answer. Compare the observed address with the route you intended, where that comparison is meaningful. The configured proxy’s listening IP need not be its public exit.

A PAC rule or bypass list can send the probe directly while another destination uses a proxy. Reading the proxy settings supplies configuration evidence; the request supplies evidence for this destination. Neither alone proves that every tab or URL follows the same route.

Keep a timeout, an HTTP error and an unexpected body distinct in the UI. “This probe failed” is more useful than declaring the entire machine offline after one request.

Erthyglow kevrennek