mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-17 13:12:07 +00:00
apply fix from eslint
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
const path = require('node:path');
|
||||
|
||||
const { app, ipcMain } = require('electron');
|
||||
const electronLocalshortcut = require('electron-localshortcut');
|
||||
|
||||
const { setOptions } = require('../../config/plugins');
|
||||
const { injectCSS } = require('../utils');
|
||||
|
||||
@ -52,7 +52,7 @@ const observer = new MutationObserver(() => {
|
||||
menu.prepend(pipButton);
|
||||
});
|
||||
|
||||
global.togglePictureInPicture = async () => {
|
||||
const togglePictureInPicture = async () => {
|
||||
if (useNativePiP) {
|
||||
const isInPiP = document.pictureInPictureElement !== null;
|
||||
const video = $('video');
|
||||
@ -72,6 +72,7 @@ global.togglePictureInPicture = async () => {
|
||||
ipcRenderer.send('picture-in-picture');
|
||||
return false;
|
||||
};
|
||||
global.togglePictureInPicture = togglePictureInPicture;
|
||||
|
||||
const listenForToggle = () => {
|
||||
const originalExitButton = $('.exit-fullscreen-button');
|
||||
@ -123,7 +124,7 @@ function observeMenu(options) {
|
||||
listenForToggle();
|
||||
|
||||
cloneButton('.player-minimize-button').addEventListener('click', async () => {
|
||||
await global.togglePictureInPicture();
|
||||
await togglePictureInPicture();
|
||||
setTimeout(() => $('#player').click());
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user