Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
1.5.9 Transparency/Widevine Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptofyre committed May 14, 2021
1 parent 6a46c7b commit 97b7599
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
18 changes: 17 additions & 1 deletion index.js
@@ -1,12 +1,14 @@
require('v8-compile-cache');
const {app, BrowserWindow, Tray, Menu} = require('electron')
const glasstron = require('glasstron');
const electron = require('electron');
const path = require('path')
const isReachable = require("is-reachable");
const nativeTheme = electron.nativeTheme;
const client = require('discord-rich-presence')('749317071145533440');
let isQuiting
let isMaximized
electron.app.commandLine.appendSwitch("enable-transparent-visuals");

// Optional Features
const customtitlebar = true // NOTE: Enables a custom macOS-isk titlebar instead of your respected platforms titlebars. Enable frame manually if disabled. (true by default)
Expand All @@ -16,9 +18,12 @@ const sitedetection = false // NOTE: Checks sites on startup if online when enab
const showscrollbars = false // NOTE: Shows scrollbars on page when enabled. (false by default)
const removeapplelogo = true // NOTE: Removes Apple Logo when enabled. (true by default)
const forcedarkmode = false // NOTE: Really only useful for Linux machines that don't support css dark mode. (false by default)
const sexytransparencymode = false // NOTE: kind of a CSS experiment that uses Glasstron as its blur renderer.
// For those not familiar with javascript in anyway shape or form just change things from false to true or vice versa. Compile accordingly.

function createWindow () {
// Uncomment below if using sexytransparencymode and remove the old one.
// const win = new glasstron.BrowserWindow({
const win = new BrowserWindow({
icon: path.join(__dirname, './assets/icon.png'),
width: 1024,
Expand All @@ -31,13 +36,20 @@ function createWindow () {
webPreferences: {
plugins: true,
preload: path.join(__dirname, './assets/MusicKitInterop.js'),
allowRunningInsecureContent: true
allowRunningInsecureContent: true,
contextIsolation: false,
sandbox: true
}
})

win.blurType = "blurbehind";
win.setBlur(true);


// Hide toolbar tooltips / bar
win.setMenuBarVisibility(false);


if (sitedetection === true) {
async function betaOnline() {
return isReachable('https://beta.music.apple.com');
Expand Down Expand Up @@ -70,6 +82,10 @@ function createWindow () {
win.webContents.executeJavaScript("const openitunes = document.getElementsByClassName('web-navigation__native-upsell'); while (openitunes.length > 0) openitunes[0].remove();");
win.webContents.executeJavaScript("while (openitunes.length > 0) openitunes[0].remove();");
win.webContents.executeJavaScript("console.log(\"Removed upsell.\")")
if (sexytransparencymode === true) {
win.webContents.executeJavaScript("document.getElementsByTagName('body')[0].style = 'background-color: rgb(25 24 24 / 84%) !important;';")
win.webContents.executeJavaScript("document.getElementsByClassName('web-chrome')[0].style = 'top: 32px; background-color: #2d2d2d40; backdrop-filter: saturate(0%) blur(25px);';")
}
if (removeapplelogo === true) {
win.webContents.executeJavaScript("const applelogo = document.getElementsByClassName('web-navigation__header web-navigation__header--logo'); while (applelogo.length > 0) applelogo[0].remove();");
win.webContents.executeJavaScript("while (applelogo.length > 0) applelogo[0].remove();");
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -3,7 +3,7 @@
"homepage": "https://github.com/iiFir3z/Apple-Music-Electron",
"name": "apple-music-electron",
"productName": "Apple Music",
"version": "1.5.8",
"version": "1.5.9",
"description": "Unofficial Electron wrapper for Apple Music created by @cryptofyre",
"license": "MIT",
"buildResources": "assets",
Expand All @@ -18,6 +18,7 @@
"discord-rich-presence": "^0.0.8",
"discord-rpc": "^3.1.4",
"electron-updater": "^4.3.5",
"glasstron": "^0.0.7",
"is-reachable": "^5.0.0",
"node-fetch": "^2.6.1",
"source-map-support": "^0.5.16",
Expand All @@ -33,7 +34,7 @@
"build": {
"electronVersion": "12.0.0",
"electronDownload": {
"version": "12.0.0-wvvmp-beta.29",
"version": "13.0.0-wvvmp-beta.26",
"mirror": "https://github.com/cryptofyre/castlabs-electron12/releases/download/v"
},
"appId": "apple-music",
Expand Down
6 changes: 6 additions & 0 deletions webpack.config.js
@@ -0,0 +1,6 @@
module.exports = {
//...
externals: {
glasstron: 'glasstron',
},
};

0 comments on commit 97b7599

Please sign in to comment.