mirror of
https://github.com/outline/outline.git
synced 2026-12-04 18:34:54 +03:00
fix: Only detect the Outline desktop app, not any Electron browser (#14387)
This commit is contained in:
1 parent
91422f2579
commit
98d1e83c48
1 file changed
+7
-2
@@ -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/");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user