tailchrome icon indicating copy to clipboard operation
tailchrome copied to clipboard

Auto-connect on start fails (requires UI render to trigger connection)

Open Runearen opened this issue 4 months ago • 4 comments

Description

The "Auto-connect on start" feature does not establish the tunnel when the browser is launched. The connection remains inactive in the background. (Hypothesis): It appears the auto-connect logic is tightly coupled with the UI component lifecycle (e.g., popup/index rendering) rather than the Manifest V3 background Service Worker lifecycle. Because MV3 does not render popups on browser start, the native messaging host (tsnet) is never commanded to initialize until the user interacts with the extension interface. Moving the trigger to chrome.runtime.onStartup.addListener() in the background script should resolve this.

Steps to Reproduce

  1. Open the extension and toggle "Auto-connect on start" to ON.
  2. Ensure the Tailscale node connects successfully.
  3. Completely close the browser (ensure no background processes are left).
  4. Launch the browser and wait a few moments.
  5. Notice that the Tailscale network is not routed/connected in the background.
  6. Click the Tailchrome extension icon in the toolbar to open the popup.
  7. See the UI briefly display "Tailscale not connected" before it automatically triggers the connection. (Workaround used to prove this: Pinning the extension's popup.html as a permanent background tab makes auto-connect work flawlessly on startup, confirming it relies on UI rendering).

Browser

Other

Browser Version

Brave 1.92.134 (Official Build) (64-bit) Chromium: 150.0.7871.63

Operating System

Linux 7.0.0-27-generic #27-Ubuntu

Extension Version

latest

Console Logs / Errors


Runearen avatar Jul 06 '26 11:07 Runearen

This appears to now have the opposite problem. When turning off "auto-connect on start", exiting the browser, and then starting the browser again, tailchrome connects (i.e., disabling "auto-connect on start" has no effect). The same thing happens when turning off auto-connect, then turning off tailchrome, and exiting the browser.

packetgeek avatar Jul 17 '26 03:07 packetgeek

This appears to now have the opposite problem. When turning off "auto-connect on start", exiting the browser, and then starting the browser again, tailchrome connects (i.e., disabling "auto-connect on start" has no effect). The same thing happens when turning off auto-connect, then turning off tailchrome, and exiting the browser.

@packetgeek what browser are you using?

dantraynor avatar Jul 18 '26 23:07 dantraynor

@dantraynor Thanks for this update. Now auto-connect works correctly at launch. 👍 The thing I would suggest now is updating Tailscale to the latest version available :)

Runearen avatar Jul 19 '26 16:07 Runearen

@Runearen No problem! And good call, the next release will have the latest version available.

dantraynor avatar Jul 20 '26 01:07 dantraynor