Merge branch 'develop' into t3chguy/safeStorage

This commit is contained in:
Michael Telatynski 2025-04-11 17:16:06 +01:00 committed by GitHub
commit f89339577e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 54 additions and 11 deletions

View File

@ -12,9 +12,7 @@ import keytar from "keytar-forked";
import { test, expect } from "../../element-desktop-test.js"; import { test, expect } from "../../element-desktop-test.js";
declare global { declare global {
interface Window { interface ElectronPlatform {
mxPlatformPeg: {
get(): {
getEventIndexingManager(): getEventIndexingManager():
| { | {
supportsEventIndexing(): Promise<boolean>; supportsEventIndexing(): Promise<boolean>;
@ -22,7 +20,11 @@ declare global {
| undefined; | undefined;
getPickleKey(userId: string, deviceId: string): Promise<string | null>; getPickleKey(userId: string, deviceId: string): Promise<string | null>;
createPickleKey(userId: string, deviceId: string): Promise<string | null>; createPickleKey(userId: string, deviceId: string): Promise<string | null>;
}; }
interface Window {
mxPlatformPeg: {
get(): ElectronPlatform;
}; };
} }
} }

View File

@ -0,0 +1,36 @@
/*
Copyright 2025 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
import { test, expect } from "../../element-desktop-test.js";
declare global {
interface ElectronPlatform {
getOidcCallbackUrl(): URL;
}
interface Window {
mxPlatformPeg: {
get(): ElectronPlatform;
};
}
}
test.describe("OIDC Native", () => {
test.slow();
test.beforeEach(async ({ page }) => {
await page.locator(".mx_Welcome").waitFor();
});
test("should use OIDC callback URL without authority component", async ({ page }) => {
await expect(
page.evaluate<string>(() => {
return window.mxPlatformPeg.get().getOidcCallbackUrl().toString();
}),
).resolves.toBe("io.element.desktop:/vector/webapp/");
});
});

View File

@ -44,7 +44,12 @@ const argv = minimist(process.argv, {
if (argv["help"]) { if (argv["help"]) {
console.log("Options:"); console.log("Options:");
console.log(" --profile-dir {path}: Path to where to store the profile."); console.log(" --profile-dir {path}: Path to where to store the profile.");
console.log(" --profile {name}: Name of alternate profile to use, allows for running multiple accounts."); console.log(
` --profile {name}: Name of alternate profile to use, allows for running multiple accounts.\n` +
` Ignored if --profile-dir is specified.\n` +
` The ELEMENT_PROFILE_DIR environment variable may be used to change the default profile path.\n` +
` It is overridden by --profile-dir, but can be combined with --profile.`,
);
console.log(" --devtools: Install and use react-devtools and react-perf."); console.log(" --devtools: Install and use react-devtools and react-perf.");
console.log( console.log(
` --config: Path to the config.json file. May also be specified via the ELEMENT_DESKTOP_CONFIG_JSON environment variable.\n` + ` --config: Path to the config.json file. May also be specified via the ELEMENT_DESKTOP_CONFIG_JSON environment variable.\n` +
@ -75,7 +80,7 @@ if (userDataPathInProtocol) {
} else if (argv["profile-dir"]) { } else if (argv["profile-dir"]) {
userDataPath = argv["profile-dir"]; userDataPath = argv["profile-dir"];
} else { } else {
let newUserDataPath = app.getPath("userData"); let newUserDataPath = process.env.ELEMENT_PROFILE_DIR ?? app.getPath("userData");
if (argv["profile"]) { if (argv["profile"]) {
newUserDataPath += "-" + argv["profile"]; newUserDataPath += "-" + argv["profile"];
} }