Download plugin - advanced options (folder, FFmpeg args)

This commit is contained in:
TC
2020-12-03 18:55:27 +01:00
parent 4d4a1f038b
commit 7b20b9339d
2 changed files with 29 additions and 7 deletions

View File

@ -7,6 +7,7 @@ let progress = null;
const downloadButton = ElementFromFile(
templatePath(__dirname, "download.html")
);
let pluginOptions = {};
const observer = new MutationObserver((mutations, observer) => {
if (!menu) {
@ -43,11 +44,13 @@ global.download = () => {
triggerAction(CHANNEL, ACTIONS.ERROR, error);
reinit();
},
reinit
reinit,
pluginOptions
);
};
function observeMenu() {
function observeMenu(options) {
pluginOptions = { ...pluginOptions, ...options };
observer.observe(document, {
childList: true,
subtree: true,