mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 04:11:47 +00:00
Merge pull request #127 from th-ch/fix-plugins-context-isolation
Fix plugins with context isolation
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
const { contextBridge } = require("electron");
|
||||
|
||||
const { ElementFromFile, templatePath, triggerAction } = require("../utils");
|
||||
const { ACTIONS, CHANNEL } = require("./actions.js");
|
||||
const { downloadVideoToMP3 } = require("./youtube-dl");
|
||||
@ -28,6 +30,9 @@ const reinit = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: re-enable once contextIsolation is set to true
|
||||
// contextBridge.exposeInMainWorld("downloader", {
|
||||
// download: () => {
|
||||
global.download = () => {
|
||||
const videoUrl = window.location.href;
|
||||
|
||||
@ -48,6 +53,7 @@ global.download = () => {
|
||||
pluginOptions
|
||||
);
|
||||
};
|
||||
// });
|
||||
|
||||
function observeMenu(options) {
|
||||
pluginOptions = { ...pluginOptions, ...options };
|
||||
|
||||
Reference in New Issue
Block a user