fix: Only detect the Outline desktop app, not any Electron browser (#14387)

This commit is contained in:
Tom Moor authored and GitHub committed 2026-10-29 08:40:09 -04:00
1 parent 91422f2579
commit 98d1e83c48
1 file changed
+7 -2
+7 -2
View File
@@ -33,10 +33,15 @@ export default class Desktop {
}
/**
* Returns true if the client is running in a desktop app.
* Returns true if the client is running in the Outline desktop app. Other
* Electron based browsers also include "Electron" in the user agent, so the
* app name token is required too.
*
* @returns true if the client is the Outline desktop app.
*/
static isElectron() {
return navigator?.userAgent?.includes("Electron");
const userAgent = navigator?.userAgent ?? "";
return userAgent.includes("Electron/") && userAgent.includes("Outline/");
}
/**