mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
fix(electron): open new window in browser
This commit is contained in:
parent
f67fafeb26
commit
fed756f6bd
1 changed files with 5 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
"use strict";
|
||||
import { app, protocol, BrowserWindow } from "electron";
|
||||
import { app, protocol, BrowserWindow, shell } from "electron";
|
||||
import { createProtocol } from "vue-cli-plugin-electron-builder/lib";
|
||||
import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer";
|
||||
import { startNeteaseMusicApi } from "./electron/services";
|
||||
|
|
@ -53,6 +53,10 @@ function createWindow() {
|
|||
win.loadURL("app://./index.html");
|
||||
}
|
||||
|
||||
win.webContents.on("new-window", function (e, url) {
|
||||
e.preventDefault();
|
||||
shell.openExternal(url);
|
||||
});
|
||||
win.on("closed", () => {
|
||||
win = null;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue