From 729dab765c958411bbcb900ad2536da2f2514a36 Mon Sep 17 00:00:00 2001
From: buvta <12312540+buvta@users.noreply.github.com>
Date: Thu, 19 Nov 2020 18:07:17 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=A4=9A=E4=BD=99=E7=9A=84mi?=
=?UTF-8?q?ni=E7=AA=97=E5=8F=A3=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/background.js | 46 +---
src/components/Play.vue | 12 +-
src/mini/Mini.vue | 535 ----------------------------------------
src/mini/main.js | 10 -
vue.config.js | 1 -
5 files changed, 2 insertions(+), 602 deletions(-)
delete mode 100644 src/mini/Mini.vue
delete mode 100644 src/mini/main.js
diff --git a/src/background.js b/src/background.js
index 2a13abe..61d9864 100644
--- a/src/background.js
+++ b/src/background.js
@@ -11,7 +11,6 @@ app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors') // 允许跨
// app.commandLine.appendSwitch('--ignore-certificate-errors', 'true') // 忽略证书相关错误
let win
-let mini
protocol.registerSchemesAsPrivileged([{ scheme: 'app', privileges: { secure: true, standard: true } }])
@@ -35,7 +34,7 @@ function createWindow () {
createProtocol('app')
win.loadURL('app://./index.html')
}
-
+
initUpdater(win)
win.on('closed', () => {
@@ -43,35 +42,6 @@ function createWindow () {
})
}
-function createMini () {
- mini = new BrowserWindow({
- width: 550,
- miniWidth: 860,
- height: 340,
- miniHeight: 180,
- frame: false,
- resizable: true,
- webPreferences: {
- sandbox: false,
- webSecurity: false,
- enableRemoteModule: true,
- nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION
- }
- })
-
- if (process.env.WEBPACK_DEV_SERVER_URL) {
- mini.loadURL(process.env.WEBPACK_DEV_SERVER_URL + 'mini')
- if (!process.env.IS_TEST) mini.webContents.openDevTools()
- } else {
- createProtocol('app')
- mini.loadURL('app://./mini.html')
- }
-
- mini.on('closed', () => {
- mini = null
- })
-}
-
if (process.platform === 'darwin') {
app.dock.show()
}
@@ -91,17 +61,6 @@ app.on('activate', () => {
}
})
-ipcMain.on('mini', () => {
- createMini()
- win.hide()
-})
-
-ipcMain.on('win', () => {
- mini.destroy()
- win.show()
- win.webContents.send('miniClosed')
-})
-
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
@@ -125,9 +84,6 @@ if (!gotTheLock) {
if (win) {
win.isFocused() ? win.blur() : win.focus()
}
- if (mini) {
- mini.isFocused() ? mini.blur() : mini.focus()
- }
})
})
}
diff --git a/src/components/Play.vue b/src/components/Play.vue
index 0cce720..4c983d6 100644
--- a/src/components/Play.vue
+++ b/src/components/Play.vue
@@ -226,7 +226,7 @@ import mt from 'mousetrap'
import { directive as onClickaway } from 'vue-clickaway'
import { exec, execFile } from 'child_process'
-const { remote, ipcRenderer, clipboard } = require('electron')
+const { remote, clipboard } = require('electron')
const VIDEO_DETAIL_CACHE = {}
@@ -1368,16 +1368,6 @@ export default {
mounted () {
this.playerInstall()
this.xg = new HlsJsPlayer(this.config)
- ipcRenderer.on('miniClosed', async () => {
- const db = await history.find({ site: this.video.key, ids: this.video.info.id })
- if (db) {
- if (this.video.info.index !== db.index) {
- this.video.info.index = db.index
- } else {
- this.getUrls()
- }
- }
- })
this.bindEvent()
this.minMaxEvent()
},
diff --git a/src/mini/Mini.vue b/src/mini/Mini.vue
deleted file mode 100644
index 86cd432..0000000
--- a/src/mini/Mini.vue
+++ /dev/null
@@ -1,535 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/mini/main.js b/src/mini/main.js
deleted file mode 100644
index a873074..0000000
--- a/src/mini/main.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import Vue from 'vue'
-import Mini from './Mini'
-import 'modern-normalize'
-import '../lib/element/index'
-
-Vue.config.productionTip = false
-
-new Vue({
- render: h => h(Mini)
-}).$mount('#app')
diff --git a/vue.config.js b/vue.config.js
index 2844ad1..bebf840 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,7 +1,6 @@
module.exports = {
pages: {
index: 'src/main.js',
- mini: 'src/mini/main.js'
},
pluginOptions: {
electronBuilder: {