- Small change to preload to define global.ipcRenderer early.
- Changed BW options and removed redundant options that (I think) are no longer used by the renderer. - Added launch args to app.ts
This commit is contained in:
parent
6dad815d48
commit
312a5a7b70
4 changed files with 28 additions and 13 deletions
|
@ -100,7 +100,8 @@
|
|||
"extends": null,
|
||||
"files": [
|
||||
"./build/**/*",
|
||||
"./resources/icons/icon.*"
|
||||
"./resources/icons/icon.*",
|
||||
"./src/**/*"
|
||||
],
|
||||
"linux": {
|
||||
"target": [
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import * as electron from 'electron';
|
||||
import * as path from 'path';
|
||||
|
||||
export class AppEvents {
|
||||
constructor(store: any) {
|
||||
|
@ -14,6 +15,28 @@ export class AppEvents {
|
|||
private static start(store: any): void {
|
||||
console.log('App started');
|
||||
|
||||
/**********************************************************************************************************************
|
||||
* Startup arguments handling
|
||||
**********************************************************************************************************************/
|
||||
if (electron.app.commandLine.hasSwitch('version') || electron.app.commandLine.hasSwitch('v')) {
|
||||
console.log(electron.app.getVersion())
|
||||
electron.app.exit()
|
||||
}
|
||||
|
||||
// Verbose Check
|
||||
if (electron.app.commandLine.hasSwitch('verbose')) {
|
||||
console.log("[Apple-Music-Electron] User has launched the application with --verbose");
|
||||
}
|
||||
|
||||
// Log File Location
|
||||
if (electron.app.commandLine.hasSwitch('log') || electron.app.commandLine.hasSwitch('l')) {
|
||||
console.log(path.join(electron.app.getPath('userData'), 'logs'))
|
||||
electron.app.exit()
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************
|
||||
* Commandline arguments
|
||||
**********************************************************************************************************************/
|
||||
switch (store.get("visual.hw_acceleration")) {
|
||||
default:
|
||||
case "default":
|
||||
|
|
|
@ -45,18 +45,11 @@ export class Win {
|
|||
frame: false,
|
||||
title: "Cider",
|
||||
vibrancy: 'dark',
|
||||
// transparent: true,
|
||||
transparent: (process.platform === "darwin"),
|
||||
hasShadow: false,
|
||||
webPreferences: {
|
||||
webviewTag: true,
|
||||
plugins: true,
|
||||
nodeIntegration: true,
|
||||
nodeIntegrationInWorker: false,
|
||||
webSecurity: false,
|
||||
allowRunningInsecureContent: true,
|
||||
enableRemoteModule: true,
|
||||
sandbox: true,
|
||||
nativeWindowOpen: true,
|
||||
contextIsolation: false,
|
||||
preload: path.join(this.paths.srcPath, './preload/cider-preload.js')
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const electron = require('electron')
|
||||
|
||||
global.ipcRenderer = require('electron').ipcRenderer;
|
||||
console.log('Loaded Preload')
|
||||
|
||||
let cache = {playParams: {id: 0}, status: null, remainingTime: 0},
|
||||
|
@ -91,6 +90,5 @@ const MusicKitInterop = {
|
|||
|
||||
process.once('loaded', () => {
|
||||
console.log("Setting ipcRenderer")
|
||||
global.ipcRenderer = electron.ipcRenderer;
|
||||
global.MusicKitInterop = MusicKitInterop;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue