Skip to content

Instantly share code, notes, and snippets.

@Araxeus

Araxeus/main.js Secret

Created February 22, 2022 20:32
Show Gist options
  • Save Araxeus/1a9e2be5705831154e057d5886e0080c to your computer and use it in GitHub Desktop.
Save Araxeus/1a9e2be5705831154e057d5886e0080c to your computer and use it in GitHub Desktop.
Electron mediasession OSD bug
const {app, BrowserWindow} = require('electron')
// v15.3.0 doesnt work
// v15.3.1 Works !
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
})
mainWindow.loadURL('https://music.youtube.com/watch?v=lYBUbBu4W08')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
{
"name": "grandiose-crowd-apologize-jnb4y",
"productName": "grandiose-crowd-apologize-jnb4y",
"description": "My Electron application description",
"keywords": [],
"main": "./main.js",
"version": "1.0.0",
"author": "Araxeus",
"scripts": {
"start": "electron ."
},
"dependencies": {},
"devDependencies": {
"electron": "17.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment