Merge pull request #45: fix(macos): non-Chrome login
@@ -90,7 +90,7 @@
90
90
|---|---|
91
91
| 🪟 Windows | Main target. Login through an embedded WebView2 |
92
92
| 🐧 Linux | Starts Google Chrome or Chromium on its own (debug port 9222, own profile in the XDG data folder) and keeps it headless in the background. When Teams asks for a login, the Chrome window shows itself and goes back to the background once you are signed in. `--endpoint` connects to a Chrome you started yourself instead. Color emoji use a bundled bitmap Noto Color Emoji font; a system COLRv1 face of the same name is left out of the font list. The window id is `rusty-teams`. On start the app offers to install itself to `~/.local/share/rusty-teams/teams` (moved, or copied when started from a cargo `target` folder) and writes `~/.local/share/applications/rusty-teams.desktop`; starting a newer build offers to replace the installed one, and Settings > General can install, replace, remove or bring the question back. The installed copy of a release build looks for new GitHub releases (Settings > General > Automatic updates) and asks before it downloads and restarts. Tray icon through StatusNotifierItem (KDE Plasma natively, GNOME with the AppIndicator extension); with "Close to tray" the window closes and the app keeps running in the tray, which opens a new window. Built-in login without Chrome is planned |
93
| 🍎 macOS | Starts Google Chrome or Chromium on its own (debug port 9222, own profile under Application Support) and keeps it headless in the background. When Teams asks for a login, the Chrome window shows itself and goes back to the background once you are signed in. `--endpoint` connects to a Chrome you started yourself instead. Universal arm64 + x86_64 `.app` bundle. Screen share uses the ScreenCaptureKit system dialog |
93
| 🍎 macOS | Starts the first Chromium browser it finds (Google Chrome, Chromium, Microsoft Edge, Brave, Helium, Vivaldi) on its own (debug port 9222, own profile under Application Support) and keeps it headless in the background. When Teams asks for a login, the Chrome window shows itself and goes back to the background once you are signed in. `--endpoint` connects to a Chrome you started yourself instead. Universal arm64 + x86_64 `.app` bundle. Screen share uses the ScreenCaptureKit system dialog |
94
94
95
95
The remaining gaps are planned, see [ROADMAP.md](ROADMAP.md).
96
96
@@ -90,7 +90,7 @@90
|---|---|90
|---|---|91
| 🪟 Windows | Main target. Login through an embedded WebView2 |91
| 🪟 Windows | Main target. Login through an embedded WebView2 |92
| 🐧 Linux | Starts Google Chrome or Chromium on its own (debug port 9222, own profile in the XDG data folder) and keeps it headless in the background. When Teams asks for a login, the Chrome window shows itself and goes back to the background once you are signed in. `--endpoint` connects to a Chrome you started yourself instead. Color emoji use a bundled bitmap Noto Color Emoji font; a system COLRv1 face of the same name is left out of the font list. The window id is `rusty-teams`. On start the app offers to install itself to `~/.local/share/rusty-teams/teams` (moved, or copied when started from a cargo `target` folder) and writes `~/.local/share/applications/rusty-teams.desktop`; starting a newer build offers to replace the installed one, and Settings > General can install, replace, remove or bring the question back. The installed copy of a release build looks for new GitHub releases (Settings > General > Automatic updates) and asks before it downloads and restarts. Tray icon through StatusNotifierItem (KDE Plasma natively, GNOME with the AppIndicator extension); with "Close to tray" the window closes and the app keeps running in the tray, which opens a new window. Built-in login without Chrome is planned |92
| 🐧 Linux | Starts Google Chrome or Chromium on its own (debug port 9222, own profile in the XDG data folder) and keeps it headless in the background. When Teams asks for a login, the Chrome window shows itself and goes back to the background once you are signed in. `--endpoint` connects to a Chrome you started yourself instead. Color emoji use a bundled bitmap Noto Color Emoji font; a system COLRv1 face of the same name is left out of the font list. The window id is `rusty-teams`. On start the app offers to install itself to `~/.local/share/rusty-teams/teams` (moved, or copied when started from a cargo `target` folder) and writes `~/.local/share/applications/rusty-teams.desktop`; starting a newer build offers to replace the installed one, and Settings > General can install, replace, remove or bring the question back. The installed copy of a release build looks for new GitHub releases (Settings > General > Automatic updates) and asks before it downloads and restarts. Tray icon through StatusNotifierItem (KDE Plasma natively, GNOME with the AppIndicator extension); with "Close to tray" the window closes and the app keeps running in the tray, which opens a new window. Built-in login without Chrome is planned |93
| 🍎 macOS | Starts Google Chrome or Chromium on its own (debug port 9222, own profile under Application Support) and keeps it headless in the background. When Teams asks for a login, the Chrome window shows itself and goes back to the background once you are signed in. `--endpoint` connects to a Chrome you started yourself instead. Universal arm64 + x86_64 `.app` bundle. Screen share uses the ScreenCaptureKit system dialog |93
| 🍎 macOS | Starts the first Chromium browser it finds (Google Chrome, Chromium, Microsoft Edge, Brave, Helium, Vivaldi) on its own (debug port 9222, own profile under Application Support) and keeps it headless in the background. When Teams asks for a login, the Chrome window shows itself and goes back to the background once you are signed in. `--endpoint` connects to a Chrome you started yourself instead. Universal arm64 + x86_64 `.app` bundle. Screen share uses the ScreenCaptureKit system dialog |94
94
95
The remaining gaps are planned, see [ROADMAP.md](ROADMAP.md).95
The remaining gaps are planned, see [ROADMAP.md](ROADMAP.md).96
96
@@ -38,7 +38,7 @@ Feature parity with the Microsoft Teams desktop client.
38
38
| Linux install, menu entry and self-update | Done | Offers to install itself to `~/.local/share/rusty-teams` with a `.desktop` entry (Settings > General to install, replace, remove or ask again); the installed release build offers new GitHub releases in a dialog (download with progress, then Restart now); the Teams icon is downloaded from Microsoft, not shipped |
39
39
| Sign in on Linux without starting Chrome by hand | Done | The app starts Chrome or Chromium headless with its own profile, shows the window for the login and hides it again afterwards; a watchdog restarts a dead or hung Chrome |
40
40
| Single instance, second start brings the window to front | Done | |
41
| Sign in on macOS without starting Chrome by hand | Done | Same managed Chrome as on Linux, profile in Application Support |
41
| Sign in on macOS without starting Chrome by hand | Done | Same managed browser as on Linux, profile in Application Support. Takes the first of Chrome, Chromium, Edge, Brave, Helium, Vivaldi; checked live with Helium |
42
42
43
43
## Chat list
44
44
@@ -38,7 +38,7 @@ Feature parity with the Microsoft Teams desktop client.38
| Linux install, menu entry and self-update | Done | Offers to install itself to `~/.local/share/rusty-teams` with a `.desktop` entry (Settings > General to install, replace, remove or ask again); the installed release build offers new GitHub releases in a dialog (download with progress, then Restart now); the Teams icon is downloaded from Microsoft, not shipped |38
| Linux install, menu entry and self-update | Done | Offers to install itself to `~/.local/share/rusty-teams` with a `.desktop` entry (Settings > General to install, replace, remove or ask again); the installed release build offers new GitHub releases in a dialog (download with progress, then Restart now); the Teams icon is downloaded from Microsoft, not shipped |39
| Sign in on Linux without starting Chrome by hand | Done | The app starts Chrome or Chromium headless with its own profile, shows the window for the login and hides it again afterwards; a watchdog restarts a dead or hung Chrome |39
| Sign in on Linux without starting Chrome by hand | Done | The app starts Chrome or Chromium headless with its own profile, shows the window for the login and hides it again afterwards; a watchdog restarts a dead or hung Chrome |40
| Single instance, second start brings the window to front | Done | |40
| Single instance, second start brings the window to front | Done | |41
| Sign in on macOS without starting Chrome by hand | Done | Same managed Chrome as on Linux, profile in Application Support |41
| Sign in on macOS without starting Chrome by hand | Done | Same managed browser as on Linux, profile in Application Support. Takes the first of Chrome, Chromium, Edge, Brave, Helium, Vivaldi; checked live with Helium |42
42
43
## Chat list43
## Chat list44
44
@@ -351,8 +351,8 @@ settings:
351
351
en: Open links and Google sign-in with
352
352
de: Links und Google-Anmeldung öffnen mit
353
353
external_browser_detail:
354
en: Does not change the Teams session browser (Chrome/Chromium is required for that).
355
de: Ändert nicht den Browser der Teams-Sitzung (dafür bleibt Chrome/Chromium nötig).
354
en: Does not change the Teams session browser (that needs a Chromium browser such as Chrome, Edge, Brave or Helium).
355
de: Ändert nicht den Browser der Teams-Sitzung (dafür bleibt ein Chromium-Browser wie Chrome, Edge, Brave oder Helium nötig).
356
356
external_browser_system:
357
357
en: System default
358
358
de: Systemstandard
@@ -1369,8 +1369,8 @@ auth:
1369
1369
en: Finishing sign-in…
1370
1370
de: Anmeldung wird abgeschlossen…
1371
1371
browser_failed:
1372
en: Could not open Chrome or Chromium
1373
de: Chrome oder Chromium konnte nicht geöffnet werden
1372
en: Could not open a Chromium browser (Chrome, Edge, Brave, Helium)
1373
de: Kein Chromium-Browser konnte geöffnet werden (Chrome, Edge, Brave, Helium)
1374
1374
browser_still_loading_hint:
1375
1375
en: The Teams logo in the browser means the login page is still loading
1376
1376
de: Das Teams-Logo im Browser heisst, die Anmeldeseite lädt noch
@@ -351,8 +351,8 @@ settings:351
en: Open links and Google sign-in with351
en: Open links and Google sign-in with352
de: Links und Google-Anmeldung öffnen mit352
de: Links und Google-Anmeldung öffnen mit353
external_browser_detail:353
external_browser_detail:354
en: Does not change the Teams session browser (Chrome/Chromium is required for that).354
en: Does not change the Teams session browser (that needs a Chromium browser such as Chrome, Edge, Brave or Helium).355
de: Ändert nicht den Browser der Teams-Sitzung (dafür bleibt Chrome/Chromium nötig).355
de: Ändert nicht den Browser der Teams-Sitzung (dafür bleibt ein Chromium-Browser wie Chrome, Edge, Brave oder Helium nötig).356
external_browser_system:356
external_browser_system:357
en: System default357
en: System default358
de: Systemstandard358
de: Systemstandard@@ -1369,8 +1369,8 @@ auth:1369
en: Finishing sign-in…1369
en: Finishing sign-in…1370
de: Anmeldung wird abgeschlossen…1370
de: Anmeldung wird abgeschlossen…1371
browser_failed:1371
browser_failed:1372
en: Could not open Chrome or Chromium1372
en: Could not open a Chromium browser (Chrome, Edge, Brave, Helium)1373
de: Chrome oder Chromium konnte nicht geöffnet werden1373
de: Kein Chromium-Browser konnte geöffnet werden (Chrome, Edge, Brave, Helium)1374
browser_still_loading_hint:1374
browser_still_loading_hint:1375
en: The Teams logo in the browser means the login page is still loading1375
en: The Teams logo in the browser means the login page is still loading1376
de: Das Teams-Logo im Browser heisst, die Anmeldeseite lädt noch1376
de: Das Teams-Logo im Browser heisst, die Anmeldeseite lädt noch@@ -16,9 +16,15 @@ const LINUX_CHROME_NAMES: [&str; 5] = [
16
16
"chrome",
17
17
];
18
18
const MACOS_CHROME_NAMES: [&str; 3] = ["google-chrome", "chromium", "chrome"];
19
const MACOS_CHROME_APP_PATHS: [&str; 2] = [
19
/// Chromium-based browsers in order of preference; each one gets its own profile, so the user's
20
/// everyday browser stays untouched.
21
const MACOS_CHROME_APP_PATHS: [&str; 6] = [
20
22
"Google Chrome.app/Contents/MacOS/Google Chrome",
21
23
"Chromium.app/Contents/MacOS/Chromium",
24
"Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
25
"Brave Browser.app/Contents/MacOS/Brave Browser",
26
"Helium.app/Contents/MacOS/Helium",
27
"Vivaldi.app/Contents/MacOS/Vivaldi",
22
28
];
23
29
24
30
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -262,7 +268,7 @@ pub(crate) fn find_chrome(
262
268
.or_else(|| find_named_chrome(names, path_variable, exists))
263
269
.ok_or_else(|| {
264
270
BrowserError::ChromeNotFound(
265
"not under /Applications, ~/Applications, or PATH".into(),
271
"no Chrome, Chromium, Edge, Brave, Helium or Vivaldi under /Applications, ~/Applications, or PATH".into(),
266
272
)
267
273
}),
268
274
}
@@ -498,9 +504,12 @@ mod tests {
498
504
PathBuf::from("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")
499
505
);
500
506
assert_eq!(
501
files[2],
507
files[MACOS_CHROME_APP_PATHS.len()],
502
508
PathBuf::from("/Users/joe/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")
503
509
);
510
assert!(files.contains(&PathBuf::from(
511
"/Applications/Helium.app/Contents/MacOS/Helium"
512
)));
504
513
assert!(names.iter().any(|name| name == "google-chrome"));
505
514
assert_eq!(
506
515
config.with_profile_name("x").profile,
@@ -16,9 +16,15 @@ const LINUX_CHROME_NAMES: [&str; 5] = [16
"chrome",16
"chrome",17
];17
];18
const MACOS_CHROME_NAMES: [&str; 3] = ["google-chrome", "chromium", "chrome"];18
const MACOS_CHROME_NAMES: [&str; 3] = ["google-chrome", "chromium", "chrome"];19
const MACOS_CHROME_APP_PATHS: [&str; 2] = [19
/// Chromium-based browsers in order of preference; each one gets its own profile, so the user's20
/// everyday browser stays untouched.21
const MACOS_CHROME_APP_PATHS: [&str; 6] = [20
"Google Chrome.app/Contents/MacOS/Google Chrome",22
"Google Chrome.app/Contents/MacOS/Google Chrome",21
"Chromium.app/Contents/MacOS/Chromium",23
"Chromium.app/Contents/MacOS/Chromium",24
"Microsoft Edge.app/Contents/MacOS/Microsoft Edge",25
"Brave Browser.app/Contents/MacOS/Brave Browser",26
"Helium.app/Contents/MacOS/Helium",27
"Vivaldi.app/Contents/MacOS/Vivaldi",22
];28
];23
29
24
#[derive(Debug, Clone, Copy, PartialEq, Eq)]30
#[derive(Debug, Clone, Copy, PartialEq, Eq)]@@ -262,7 +268,7 @@ pub(crate) fn find_chrome(262
.or_else(|| find_named_chrome(names, path_variable, exists))268
.or_else(|| find_named_chrome(names, path_variable, exists))263
.ok_or_else(|| {269
.ok_or_else(|| {264
BrowserError::ChromeNotFound(270
BrowserError::ChromeNotFound(265
"not under /Applications, ~/Applications, or PATH".into(),271
"no Chrome, Chromium, Edge, Brave, Helium or Vivaldi under /Applications, ~/Applications, or PATH".into(),266
)272
)267
}),273
}),268
}274
}@@ -498,9 +504,12 @@ mod tests {498
PathBuf::from("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")504
PathBuf::from("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")499
);505
);500
assert_eq!(506
assert_eq!(501
files[2],507
files[MACOS_CHROME_APP_PATHS.len()],502
PathBuf::from("/Users/joe/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")508
PathBuf::from("/Users/joe/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")503
);509
);510
assert!(files.contains(&PathBuf::from(511
"/Applications/Helium.app/Contents/MacOS/Helium"512
)));504
assert!(names.iter().any(|name| name == "google-chrome"));513
assert!(names.iter().any(|name| name == "google-chrome"));505
assert_eq!(514
assert_eq!(506
config.with_profile_name("x").profile,515
config.with_profile_name("x").profile,@@ -76,14 +76,14 @@ pub(crate) fn major_from_directory_names<'a>(names: impl Iterator<Item = &'a str
76
76
.max()
77
77
}
78
78
79
/// The Chromium major from `--version`. Forks print their own version first, as in
80
/// "Helium 0.21.3.1 (Chromium 157.0.8103.78)", so the highest major wins.
79
81
pub(crate) fn major_from_version_output(output: &str) -> Option<u32> {
80
output.split_whitespace().find_map(|word| {
81
word.split('.')
82
.next()?
83
.parse::<u32>()
84
.ok()
85
.filter(|_| word.contains('.'))
86
})
82
output
83
.split(|character: char| character.is_whitespace() || character == '(' || character == ')')
84
.filter(|word| word.contains('.'))
85
.filter_map(|word| word.split('.').next()?.parse::<u32>().ok())
86
.max()
87
87
}
88
88
89
89
const FALLBACK_MAJOR: u32 = 150;
@@ -280,6 +280,10 @@ mod tests {
280
280
major_from_version_output("Chromium 131.0.6778.85 snap"),
281
281
Some(131)
282
282
);
283
assert_eq!(
284
major_from_version_output("Helium 0.21.3.1 (Chromium 157.0.8103.78)\n"),
285
Some(157)
286
);
283
287
assert_eq!(major_from_version_output("nothing"), None);
284
288
}
285
289
@@ -76,14 +76,14 @@ pub(crate) fn major_from_directory_names<'a>(names: impl Iterator<Item = &'a str76
.max()76
.max()77
}77
}78
78
79
/// The Chromium major from `--version`. Forks print their own version first, as in80
/// "Helium 0.21.3.1 (Chromium 157.0.8103.78)", so the highest major wins.79
pub(crate) fn major_from_version_output(output: &str) -> Option<u32> {81
pub(crate) fn major_from_version_output(output: &str) -> Option<u32> {80
output.split_whitespace().find_map(|word| {82
output81
word.split('.')83
.split(|character: char| character.is_whitespace() || character == '(' || character == ')')82
.next()?84
.filter(|word| word.contains('.'))83
.parse::<u32>()85
.filter_map(|word| word.split('.').next()?.parse::<u32>().ok())84
.ok()86
.max()85
.filter(|_| word.contains('.'))86
})87
}87
}88
88
89
const FALLBACK_MAJOR: u32 = 150;89
const FALLBACK_MAJOR: u32 = 150;@@ -280,6 +280,10 @@ mod tests {280
major_from_version_output("Chromium 131.0.6778.85 snap"),280
major_from_version_output("Chromium 131.0.6778.85 snap"),281
Some(131)281
Some(131)282
);282
);283
assert_eq!(284
major_from_version_output("Helium 0.21.3.1 (Chromium 157.0.8103.78)\n"),285
Some(157)286
);283
assert_eq!(major_from_version_output("nothing"), None);287
assert_eq!(major_from_version_output("nothing"), None);284
}288
}285
289
@@ -21,6 +21,7 @@ Tokens are not written to disk. The browser profile holds the session.
21
21
22
22
## Consequences
23
23
24
- Linux and macOS need a Chrome or Chromium install.
24
- Linux needs a Chrome or Chromium install. macOS takes the first Chromium browser it finds: Chrome, Chromium, Edge, Brave, Helium or Vivaldi. Each runs with the app's own profile, so the user's everyday profile is never touched.
25
- Forks print their own version in `--version` (`Helium 0.21.3.1 (Chromium 157.0.8103.78)`), so the user agent takes the highest major in that line.
25
26
- Sign-in bugs are browser and profile bugs, not a second token store to rotate.
26
27
- The headless user agent must look like desktop Chrome on that OS, or Microsoft rejects the session.
@@ -21,6 +21,7 @@ Tokens are not written to disk. The browser profile holds the session.21
21
22
## Consequences22
## Consequences23
23
24
- Linux and macOS need a Chrome or Chromium install.24
- Linux needs a Chrome or Chromium install. macOS takes the first Chromium browser it finds: Chrome, Chromium, Edge, Brave, Helium or Vivaldi. Each runs with the app's own profile, so the user's everyday profile is never touched.25
- Forks print their own version in `--version` (`Helium 0.21.3.1 (Chromium 157.0.8103.78)`), so the user agent takes the highest major in that line.25
- Sign-in bugs are browser and profile bugs, not a second token store to rotate.26
- Sign-in bugs are browser and profile bugs, not a second token store to rotate.26
- The headless user agent must look like desktop Chrome on that OS, or Microsoft rejects the session.27
- The headless user agent must look like desktop Chrome on that OS, or Microsoft rejects the session.