|
|
|
@ -89,6 +89,19 @@ function checkMaxDownloads() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
checkMaxDownloads();
|
|
|
|
checkMaxDownloads();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get system proxy
|
|
|
|
|
|
|
|
getSystemProxy("https://www.google.com").then(proxyInfo => {
|
|
|
|
|
|
|
|
if (proxyInfo != "DIRECT") {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const proxyUrl = proxyInfo.split(" ")[1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proxy = proxyUrl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("System proxy: " + proxy)
|
|
|
|
|
|
|
|
} catch (_) {}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// Check for auto updates
|
|
|
|
// Check for auto updates
|
|
|
|
let autoUpdate = true;
|
|
|
|
let autoUpdate = true;
|
|
|
|
const autoUpdateStatus = localStorage.getItem("autoUpdate");
|
|
|
|
const autoUpdateStatus = localStorage.getItem("autoUpdate");
|
|
|
|
@ -345,6 +358,7 @@ async function getInfo(url) {
|
|
|
|
|
|
|
|
|
|
|
|
proxy = getLocalStorageItem("proxy");
|
|
|
|
proxy = getLocalStorageItem("proxy");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Whether to use browser cookies or not
|
|
|
|
// Whether to use browser cookies or not
|
|
|
|
if (localStorage.getItem("browser")) {
|
|
|
|
if (localStorage.getItem("browser")) {
|
|
|
|
browser = localStorage.getItem("browser");
|
|
|
|
browser = localStorage.getItem("browser");
|
|
|
|
@ -1408,6 +1422,11 @@ function afterSave(location, filename, progressId, thumbnail) {
|
|
|
|
window.scrollTo(0, document.body.scrollHeight);
|
|
|
|
window.scrollTo(0, document.body.scrollHeight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function getSystemProxy(url) {
|
|
|
|
|
|
|
|
const proxy = await ipcRenderer.invoke("get-proxy", url);
|
|
|
|
|
|
|
|
return proxy;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function showItem(location, filename) {
|
|
|
|
function showItem(location, filename) {
|
|
|
|
shell.showItemInFolder(`${path.join(location, filename)}`);
|
|
|
|
shell.showItemInFolder(`${path.join(location, filename)}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|