Fix: #108 NowPlaying of iTunes on macOS
This commit is contained in:
		@@ -45,12 +45,8 @@ onmessage = function (e) {
 | 
				
			|||||||
    } else if (e.data[0] == "aboutData") {
 | 
					    } else if (e.data[0] == "aboutData") {
 | 
				
			||||||
        ipc.send('aboutData', "");
 | 
					        ipc.send('aboutData', "");
 | 
				
			||||||
    } else if (e.data[0] == "itunes") {
 | 
					    } else if (e.data[0] == "itunes") {
 | 
				
			||||||
        console.log("NowPlaying" + ipc.listenerCount('itunes-np'))
 | 
					        console.log("NowPlaying")
 | 
				
			||||||
        if (ipc.listenerCount('itunes-np') > 1) {
 | 
					        ipc.send("itunes", e.data[1])
 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            ipc.send("itunes", e.data[1])
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    } else if (e.data[0] == "themeCSSRequest") {
 | 
					    } else if (e.data[0] == "themeCSSRequest") {
 | 
				
			||||||
        ipc.send('theme-css-request', e.data[1]);
 | 
					        ipc.send('theme-css-request', e.data[1]);
 | 
				
			||||||
    } else if (e.data[0] == "downloadButton") {
 | 
					    } else if (e.data[0] == "downloadButton") {
 | 
				
			||||||
@@ -148,7 +144,7 @@ ipc.on('theme-json-create-complete', function (event, args) {
 | 
				
			|||||||
    postMessage(["ctLoad", ""], "*")
 | 
					    postMessage(["ctLoad", ""], "*")
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
//spotify.js
 | 
					//spotify.js
 | 
				
			||||||
ipc.once('itunes-np', function (event, arg) {
 | 
					ipc.on('itunes-np', function (event, arg) {
 | 
				
			||||||
    postMessage(["npCore", arg], "*")
 | 
					    postMessage(["npCore", arg], "*")
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
//tips.js
 | 
					//tips.js
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,8 @@ function np(mainWindow) {
 | 
				
			|||||||
                    console.error(error);
 | 
					                    console.error(error);
 | 
				
			||||||
                    e.sender.webContents.send('itunes-np', error);
 | 
					                    e.sender.webContents.send('itunes-np', error);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user