diff --git a/plugin.xml b/plugin.xml index 0960f34e..9f54c61c 100644 --- a/plugin.xml +++ b/plugin.xml @@ -31,6 +31,10 @@ + + + + diff --git a/src/electron/index.js b/src/electron/index.js index 14c34620..86e4d1b2 100644 --- a/src/electron/index.js +++ b/src/electron/index.js @@ -328,6 +328,7 @@ const DOWNLOAD_IMPLS = { { // ISSUES // - undici.request ignores system/os trust store -> self-signed enterprise CA's won't work + // - how to apply OverrideUserAgent/AppendUserAgent ? return new Promise(async (resolve, reject) => { try @@ -394,6 +395,7 @@ const DOWNLOAD_IMPLS = { { // ISSUES // - fetch ignores system/os trust store -> self-signed enterprise CA's won't work + // - how to apply OverrideUserAgent/AppendUserAgent ? return new Promise(async (resolve, reject) => { try @@ -459,7 +461,7 @@ const DOWNLOAD_IMPLS = { } -const fileTransferPlugin = { +const pluginAPI = { /** * @param {string} source @@ -519,7 +521,10 @@ const fileTransferPlugin = { form.append(key, params[key]); }) - // progress currently not supported + // ISSUES + // - system/os trust store + // - progress + // - how to apply OverrideUserAgent/AppendUserAgent ? fetch(target, { headers: form.getHeaders(headers), method: httpMethod, @@ -619,6 +624,10 @@ const fileTransferPlugin = { form.append(key, params[key]); }) + // ISSUES + // - system/os trust store + // - how to apply OverrideUserAgent/AppendUserAgent ? + xhr.open(httpMethod, target); for (const header in headers) @@ -757,6 +766,10 @@ const fileTransferPlugin = { form.append(key, params[key]); }) + // ISSUES + // - system/os trust store ? + // - how to apply OverrideUserAgent/AppendUserAgent ? + req = (target.startsWith("https:") ? https : http).request(target, { method: httpMethod, headers: form.getHeaders(headers), @@ -932,11 +945,11 @@ const fileTransferPlugin = { */ const plugin = function (action, args, callbackContext) { - if (!fileTransferPlugin[action]) + if (!pluginAPI[action]) return false; try { - fileTransferPlugin[action](args, callbackContext) + pluginAPI[action](args, callbackContext) } catch (e) { console.error(action + ' failed', e);