mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
feat(deeplink): implement custom deep link handling and remove electron-app-universal-protocol-client
This commit is contained in:
@@ -3,14 +3,15 @@ import { createRequire } from 'node:module'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import path from 'node:path'
|
||||
import os from 'node:os'
|
||||
import { electronAppUniversalProtocolClient } from 'electron-app-universal-protocol-client'
|
||||
|
||||
import { handleUrlScheme } from './handle-url-scheme.js'
|
||||
import './handle-url-scheme.js'
|
||||
|
||||
// Assure single instance application
|
||||
if (!app.requestSingleInstanceLock()) {
|
||||
app.exit(0);
|
||||
}
|
||||
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
@@ -83,17 +84,6 @@ async function createWindow() {
|
||||
return { action: 'deny' }
|
||||
})
|
||||
// win.webContents.on('will-navigate', (event, url) => { }) #344
|
||||
|
||||
// Initialize universal protocol client
|
||||
electronAppUniversalProtocolClient.on(
|
||||
'request',
|
||||
handleUrlScheme
|
||||
);
|
||||
|
||||
await electronAppUniversalProtocolClient.initialize({
|
||||
protocol: 'apmstore',
|
||||
mode: 'development', // Make sure to use 'production' when script is executed in bundled app
|
||||
});
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
Reference in New Issue
Block a user