fix(renderer): fix traffic light

This commit is contained in:
JellyBrick
2025-05-11 22:56:08 +09:00
parent a257d4dfbc
commit 8f18fb80ea

View File

@ -32,18 +32,6 @@ let firstDataLoaded = false;
registerWindowDefaultTrustedTypePolicy();
{
let osType = 'Unknown';
if (window.electronIs.osx()) {
osType = 'Macintosh';
} else if (window.electronIs.windows()) {
osType = 'Windows';
} else if (window.electronIs.linux()) {
osType = 'Linux';
}
document.documentElement.setAttribute('data-os', osType);
}
async function listenForApiLoad() {
if (!isApiLoaded) {
api = document.querySelector('#movie_player');
@ -56,6 +44,19 @@ async function listenForApiLoad() {
}
async function onApiLoaded() {
// Workaround for macOS traffic lights
{
let osType = 'Unknown';
if (window.electronIs.osx()) {
osType = 'Macintosh';
} else if (window.electronIs.windows()) {
osType = 'Windows';
} else if (window.electronIs.linux()) {
osType = 'Linux';
}
document.documentElement.setAttribute('data-os', osType);
}
// Workaround for #2459
document
.querySelector('button.video-button.ytmusic-av-toggle')