From 5f03b2be8a67dec57f43f7645e49ff9233e73493 Mon Sep 17 00:00:00 2001 From: julienmalard Date: Wed, 20 Nov 2024 18:01:04 +0530 Subject: [PATCH 1/3] Premier test avec liens profonds --- package.json | 1 + packages/main/src/index.ts | 19 +++++++++++++++++++ pnpm-lock.yaml | 13 +++++++++++++ 3 files changed, 33 insertions(+) diff --git a/package.json b/package.json index 4f6e40f78..04024abdc 100644 --- a/package.json +++ b/package.json @@ -109,6 +109,7 @@ "d3": "^7.9.0", "deep-equal": "^2.2.3", "direction": "^2.0.1", + "electron-app-universal-protocol-client": "^2.1.1", "electron-updater": "6.3.9", "ennikkai": "^2.3.2", "events": "^3.3.0", diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index 3c34312ce..42a6afd53 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts @@ -2,6 +2,7 @@ import {app} from 'electron'; import './security-restrictions'; import {gestionnaireFenĂȘtres} from '/@/constellation'; import {restoreOrCreateWindow} from '/@/mainWindow'; +import { electronAppUniversalProtocolClient } from 'electron-app-universal-protocol-client'; /** * Prevent electron from running multiple instances. @@ -47,6 +48,24 @@ app .then(restoreOrCreateWindow) .catch(e => console.error('Failed create window:', e)); +app + .whenReady() + .then(async ()=>{ + electronAppUniversalProtocolClient.on( + 'request', + async (requestUrl) => { + // Handle the request + + console.log(requestUrl); + }, + ); + + await electronAppUniversalProtocolClient.initialize({ + protocol: 'your-app-id3', + mode: 'development', // Make sure to use 'production' when script is executed in bundled app + }); + }); + /** * Install Vue.js or any other extension in development mode only. * Note: You must install `electron-devtools-installer` manually diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2e632df4..fd2d6068f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,6 +77,9 @@ importers: direction: specifier: ^2.0.1 version: 2.0.1 + electron-app-universal-protocol-client: + specifier: ^2.1.1 + version: 2.1.1(electron@33.2.0) electron-updater: specifier: 6.3.9 version: 6.3.9 @@ -3502,6 +3505,11 @@ packages: engines: {node: '>=0.10.0'} hasBin: true + electron-app-universal-protocol-client@2.1.1: + resolution: {integrity: sha512-3oX46dltrJl3yxa5c5JmM4jJCv44mzPgcF/i53t615mjRY/oJBmX3jIatd5nb1O/pj/BVW0EW2ZtAWSweXBAeA==} + peerDependencies: + electron: '>12.0.0' + electron-builder-squirrel-windows@26.0.0-alpha.6: resolution: {integrity: sha512-M57Xzi4dhdnSrzSDkgYm0ZgGrosQPLTMbO+mfDqhXBOdevdsqbANnEF+SaZ9u2PNuVW907e8Few39JLebWmzsQ==} @@ -11977,6 +11985,11 @@ snapshots: dependencies: jake: 10.9.2 + electron-app-universal-protocol-client@2.1.1(electron@33.2.0): + dependencies: + electron: 33.2.0 + typed-emitter: 2.1.0 + electron-builder-squirrel-windows@26.0.0-alpha.6(dmg-builder@26.0.0-alpha.6): dependencies: app-builder-lib: 26.0.0-alpha.6(dmg-builder@26.0.0-alpha.6)(electron-builder-squirrel-windows@26.0.0-alpha.6) From 8242d4b17f4c975bb62913c8baebdf25033273ff Mon Sep 17 00:00:00 2001 From: julienmalard Date: Fri, 22 Nov 2024 09:27:12 +0530 Subject: [PATCH 2/3] =?UTF-8?q?V=C3=A9rifier=20existence=20de=20`fermer`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e.spec.ts b/tests/e2e.spec.ts index d21d3c855..98ab34c9c 100644 --- a/tests/e2e.spec.ts +++ b/tests/e2e.spec.ts @@ -24,7 +24,7 @@ describe('Test fenĂȘtre appli', function () { }); afterAll(async () => { - await fermer(); + await fermer?.(); }); test('Main window state', async context => { From 845b53d8d12b48c6143ffb8ae6c756ade1175f5e Mon Sep 17 00:00:00 2001 From: julienmalard Date: Fri, 22 Nov 2024 09:30:48 +0530 Subject: [PATCH 3/3] =?UTF-8?q?Sp=C3=A9cifier=20environnement=20et=20proto?= =?UTF-8?q?cole?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/main/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index 42a6afd53..cf2c9dc44 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts @@ -61,8 +61,8 @@ app ); await electronAppUniversalProtocolClient.initialize({ - protocol: 'your-app-id3', - mode: 'development', // Make sure to use 'production' when script is executed in bundled app + protocol: 'constl', + mode: import.meta.env.DEV ? 'development' : 'production', }); });