Skip to content

Commit

Permalink
fix edge:// problem, update packageManager
Browse files Browse the repository at this point in the history
  • Loading branch information
lony2003 committed Jun 14, 2024
1 parent e8495b9 commit 1b4fa66
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions electron/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {app, BrowserWindow, dialog, ipcMain, Menu, nativeTheme, shell} from 'electron'
import {app, BrowserWindow, dialog, ipcMain, Menu, nativeTheme, shell, protocol, net} from 'electron'
import contextMenu from 'electron-context-menu'
import path from 'node:path'
import Store from 'electron-store'
import * as urlUtil from "node:url"
import {autoUpdater, UpdateInfo} from "electron-updater"
import * as url from "node:url";

// The built directory structure
//
Expand Down Expand Up @@ -436,12 +437,16 @@ function createWindow() {
// })
}

protocol.registerSchemesAsPrivileged([
{ scheme: 'edge', privileges: { standard: true, supportFetchAPI: true } }
])

app.whenReady().then(() => {

protocol.handle('edge', (request) => {
const filePath = request.url.slice('edge://'.length)
return net.fetch(url.pathToFileURL(path.join(__dirname, filePath)).toString())
})
return net.fetch(new URL(filePath, 'file:').toString())
})

autoUpdater.autoDownload = false;
autoUpdater.autoInstallOnAppQuit = true;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"vite-plugin-electron-renderer": "^0.14.5",
"vue-tsc": "^1.8.8"
},
"main": "dist-electron/main.js"
"main": "dist-electron/main.js",
"packageManager": "[email protected]+sha1.01bf39424f1008f29012bbae851d2acb8a20a0d0"
}

0 comments on commit 1b4fa66

Please sign in to comment.