更新6.x的API
parent
d1dcba7711
commit
b72a8d4780
|
@ -25,15 +25,14 @@ const log = console.log
|
|||
const fs = require('iofs')
|
||||
const path = require('path')
|
||||
|
||||
const { remote, ipcRenderer, screen } = require('electron')
|
||||
const { remote, ipcRenderer } = require('electron')
|
||||
const { createDesktopLrcWindow, createMiniWindow } = remote.require(
|
||||
'./tools/windows'
|
||||
)
|
||||
const MAIN_SCREEN = screen.getPrimaryDisplay()
|
||||
|
||||
const WIN = remote.getCurrentWindow()
|
||||
const __LRC__ = createDesktopLrcWindow(MAIN_SCREEN)
|
||||
const __MINI__ = createMiniWindow(MAIN_SCREEN)
|
||||
const __LRC__ = createDesktopLrcWindow(screen)
|
||||
const __MINI__ = createMiniWindow(screen)
|
||||
|
||||
const PLAY_MODE = {
|
||||
0: 'all',
|
||||
|
|
|
@ -41,7 +41,9 @@ const ROOT = __dirname
|
|||
app.commandLine.appendSwitch('--lang', 'zh-CN')
|
||||
app.commandLine.appendSwitch('--autoplay-policy', 'no-user-gesture-required')
|
||||
|
||||
protocol.registerStandardSchemes(['app'], { secure: true })
|
||||
protocol.registerSchemesAsPrivileged([
|
||||
{ scheme: 'app', privileges: { secure: true, standard: true } }
|
||||
])
|
||||
|
||||
/* ----------------------------------------------------- */
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ exports.createMainWindow = function(icon) {
|
|||
icon,
|
||||
webPreferences: {
|
||||
webSecurity: false,
|
||||
experimentalFeatures: true
|
||||
experimentalFeatures: true,
|
||||
nodeIntegration: true
|
||||
},
|
||||
show: false
|
||||
})
|
||||
|
@ -74,12 +75,15 @@ exports.createDesktopLrcWindow = function(screen) {
|
|||
resizable: false,
|
||||
alwaysOnTop: true,
|
||||
skipTaskbar: true,
|
||||
x: (screen.size.width - 1024) / 2,
|
||||
y: screen.size.height - 100,
|
||||
x: (screen.width - 1024) / 2,
|
||||
y: screen.height - 100,
|
||||
transparent: true,
|
||||
hasShadow: false,
|
||||
thickFrame: false,
|
||||
show: false
|
||||
show: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
win.loadURL('app://local/desktop-lrc.html')
|
||||
|
@ -98,10 +102,13 @@ exports.createMiniWindow = function(screen) {
|
|||
resizable: false,
|
||||
alwaysOnTop: true,
|
||||
skipTaskbar: true,
|
||||
x: screen.size.width - 320,
|
||||
x: screen.width - 320,
|
||||
y: 0,
|
||||
thickFrame: false,
|
||||
show: false
|
||||
show: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
win.loadURL('app://local/mini-win.html')
|
||||
|
|
Reference in New Issue