- 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,
|
"extends": null,
|
||||||
"files": [
|
"files": [
|
||||||
"./build/**/*",
|
"./build/**/*",
|
||||||
"./resources/icons/icon.*"
|
"./resources/icons/icon.*",
|
||||||
|
"./src/**/*"
|
||||||
],
|
],
|
||||||
"linux": {
|
"linux": {
|
||||||
"target": [
|
"target": [
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import * as electron from 'electron';
|
import * as electron from 'electron';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
export class AppEvents {
|
export class AppEvents {
|
||||||
constructor(store: any) {
|
constructor(store: any) {
|
||||||
|
@ -14,6 +15,28 @@ export class AppEvents {
|
||||||
private static start(store: any): void {
|
private static start(store: any): void {
|
||||||
console.log('App started');
|
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")) {
|
switch (store.get("visual.hw_acceleration")) {
|
||||||
default:
|
default:
|
||||||
case "default":
|
case "default":
|
||||||
|
|
|
@ -45,18 +45,11 @@ export class Win {
|
||||||
frame: false,
|
frame: false,
|
||||||
title: "Cider",
|
title: "Cider",
|
||||||
vibrancy: 'dark',
|
vibrancy: 'dark',
|
||||||
// transparent: true,
|
transparent: (process.platform === "darwin"),
|
||||||
hasShadow: false,
|
hasShadow: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
webviewTag: true,
|
|
||||||
plugins: true,
|
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
nodeIntegrationInWorker: false,
|
|
||||||
webSecurity: false,
|
|
||||||
allowRunningInsecureContent: true,
|
|
||||||
enableRemoteModule: true,
|
|
||||||
sandbox: true,
|
sandbox: true,
|
||||||
nativeWindowOpen: true,
|
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
preload: path.join(this.paths.srcPath, './preload/cider-preload.js')
|
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')
|
console.log('Loaded Preload')
|
||||||
|
|
||||||
let cache = {playParams: {id: 0}, status: null, remainingTime: 0},
|
let cache = {playParams: {id: 0}, status: null, remainingTime: 0},
|
||||||
|
@ -91,6 +90,5 @@ const MusicKitInterop = {
|
||||||
|
|
||||||
process.once('loaded', () => {
|
process.once('loaded', () => {
|
||||||
console.log("Setting ipcRenderer")
|
console.log("Setting ipcRenderer")
|
||||||
global.ipcRenderer = electron.ipcRenderer;
|
|
||||||
global.MusicKitInterop = MusicKitInterop;
|
global.MusicKitInterop = MusicKitInterop;
|
||||||
});
|
});
|
Loading…
Add table
Add a link
Reference in a new issue