Skip to content

fix browser detection for install instructions#20

Open
clstokes wants to merge 1 commit into
tailscale:mainfrom
clstokes:clstokes/fix-browser-id
Open

fix browser detection for install instructions#20
clstokes wants to merge 1 commit into
tailscale:mainfrom
clstokes:clstokes/fix-browser-id

Conversation

@clstokes
Copy link
Copy Markdown
Contributor

Chrome added a browser namespace (https://developer.chrome.com/docs/extensions/develop/concepts/browser-namespace) so go run ... --install=... instructions provided to the end user were specific to Firefox and didn't work for Chrome.

Chrome added a `browser` namespace (https://developer.chrome.com/docs/extensions/develop/concepts/browser-namespace) so `go run ... --install=...` instructions provided to the end user were specific to Firefox and didn't work for Chrome.

Signed-off-by: Cameron Stokes <cameron@tailscale.com>
@clstokes clstokes force-pushed the clstokes/fix-browser-id branch from 0ed38b8 to abebf6f Compare May 17, 2026 22:15
@bradfitz
Copy link
Copy Markdown
Member

I don't understand the problem.

You talk about "go run" giving bad instructions, but "go run" doesn't use this JavaScript code you're modifying.

Also, we have two copies of the browserByte stuff stuff already, one in Chrome and one in Firefox:

$ git grep browserByte
background.js:// browserByte returns either "F" for Firefox or "C" for chrome.
background.js:function browserByte() {
background.js:        browserByte() +
firefox/background.js:// browserByte returns either "F" for Firefox or "C" for chrome.
firefox/background.js:function browserByte() {
firefox/background.js:        browserByte() +

And you only modified one of them.

The original intention, IIRC, was for background.js to be used by both, but then it was forked instead, so at that point there's no reason for that function to even exist, really. Chrome can just return (or use "C") and Firefox can use "F" always, without any detection.

/cc @Erisa

@clstokes
Copy link
Copy Markdown
Contributor Author

You talk about "go run" giving bad instructions, but "go run" doesn't use this JavaScript code you're modifying.

Apologies for the poor explanation. The browser extension provides the go run ... command to the user in the during initial setup in the browser. Those instructions are wrong in Chrome now due to using the F code.

Also, we have two copies of the browserByte stuff stuff already, one in Chrome and one in Firefox:
And you only modified one of them.

Yup, I missed updating the Firefox one, though it's working as-is anyway. I don't know what it would look like to unfork the code and have shared code between the browser implementations, so maybe it's simplest to just hardcode C in the Chrome codebase and F in the Firefox codebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants