mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-20 06:32:05 +00:00
fix(renderer): fix traffic light
This commit is contained in:
@ -32,18 +32,6 @@ let firstDataLoaded = false;
|
|||||||
|
|
||||||
registerWindowDefaultTrustedTypePolicy();
|
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() {
|
async function listenForApiLoad() {
|
||||||
if (!isApiLoaded) {
|
if (!isApiLoaded) {
|
||||||
api = document.querySelector('#movie_player');
|
api = document.querySelector('#movie_player');
|
||||||
@ -56,6 +44,19 @@ async function listenForApiLoad() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function onApiLoaded() {
|
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
|
// Workaround for #2459
|
||||||
document
|
document
|
||||||
.querySelector('button.video-button.ytmusic-av-toggle')
|
.querySelector('button.video-button.ytmusic-av-toggle')
|
||||||
|
|||||||
Reference in New Issue
Block a user