mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 04:11:47 +00:00
feat: enable context-isolation (#1361)
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { toKeyEvent } from 'keyboardevent-from-electron-accelerator';
|
||||
import keyEventAreEqual from 'keyboardevents-areequal';
|
||||
|
||||
@ -6,7 +5,7 @@ import pipHTML from './templates/picture-in-picture.html';
|
||||
|
||||
import { getSongMenu } from '../../providers/dom-elements';
|
||||
|
||||
import { ElementFromHtml } from '../utils';
|
||||
import { ElementFromHtml } from '../utils-renderer';
|
||||
|
||||
import type { ConfigType } from '../../config/dynamic';
|
||||
|
||||
@ -85,7 +84,7 @@ const togglePictureInPicture = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
ipcRenderer.send('picture-in-picture');
|
||||
window.ipcRenderer.send('picture-in-picture');
|
||||
return false;
|
||||
};
|
||||
// For UI (HTML)
|
||||
@ -105,7 +104,7 @@ const listenForToggle = () => {
|
||||
|
||||
const titlebar = $<HTMLElement>('.cet-titlebar');
|
||||
|
||||
ipcRenderer.on('pip-toggle', (_, isPip: boolean) => {
|
||||
window.ipcRenderer.on('pip-toggle', (_, isPip: boolean) => {
|
||||
if (originalExitButton && player) {
|
||||
if (isPip) {
|
||||
replaceButton('.exit-fullscreen-button', originalExitButton)?.addEventListener('click', () => togglePictureInPicture());
|
||||
|
||||
Reference in New Issue
Block a user