mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
feat: overhaul application to APM 应用商店 with enhanced download management
- Removed CHANGELOG.md and electron-vite-vue.gif files. - Updated LICENSE to reflect new copyright holder. - Transformed README.md to reflect new project identity and features. - Introduced DownloadQueue and DownloadDetail components for managing downloads. - Implemented download simulation and management logic in App.vue. - Added URL scheme handling in Electron main process. - Integrated electron-app-universal-protocol-client for protocol handling. - Updated package.json to include new dependencies.
This commit is contained in:
5
electron/main/handle-url-scheme.ts
Normal file
5
electron/main/handle-url-scheme.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { dialog } from 'electron'
|
||||
|
||||
export async function handleUrlScheme(requestUrl: string) {
|
||||
console.log('Handling URL scheme request:', requestUrl);
|
||||
}
|
||||
@@ -1,8 +1,15 @@
|
||||
import { app, BrowserWindow, shell, ipcMain } from 'electron'
|
||||
import { app, BrowserWindow, shell, ipcMain, dialog } from 'electron'
|
||||
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'
|
||||
|
||||
if (!app.requestSingleInstanceLock()) {
|
||||
app.exit(0);
|
||||
}
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
@@ -76,6 +83,17 @@ 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