mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
fix(renderer): fix traffic light
This commit is contained in:
@ -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')
|
||||
|
||||
Reference in New Issue
Block a user