diff --git a/src/front/cobalt.js b/src/front/cobalt.js index 08c642d1..a11a46d8 100644 --- a/src/front/cobalt.js +++ b/src/front/cobalt.js @@ -344,9 +344,9 @@ function resetSettings() { localStorage.clear(); window.location.reload(); } -if (window.location.hostname.endsWith(".onion")) document.getElementById('paste').style = "pointer-events:none;visibility:hidden;"; +if (window.location.hostname.endsWith(".onion") && !(navigator.getBattery())) document.getElementById('paste').style = "pointer-events:none;visibility:hidden;"; async function pasteClipboard() { - if (window.location.hostname.endsWith(".onion")) return + if (window.location.hostname.endsWith(".onion") && !(navigator.getBattery())) return try { let t = await navigator.clipboard.readText(); if (regex.test(t)) { @@ -391,7 +391,7 @@ async function download(url) { if (url.includes("youtube.com/") || url.includes("/youtu.be/")) req.vCodec = sGet("vCodec").slice(0, 4); if ((url.includes("tiktok.com/") || url.includes("douyin.com/")) && sGet("disableTikTokWatermark") === "true") req.isNoTTWatermark = true; } - if (window.location.hostname.endsWith(".onion") && !(sGet("onionPreference") == "noOnions")) req.onionPreference = sGet("onionPreference") + if (window.location.hostname.endsWith(".onion") && !(sGet("onionPreference") == "noOnions")) req.onionPreference = sGet("onionPreference"); if (sGet("disableMetadata") === "true") req.disableMetadata = true; diff --git a/src/modules/processing/services/reddit.js b/src/modules/processing/services/reddit.js index 4d2fd9dc..0f3918c0 100644 --- a/src/modules/processing/services/reddit.js +++ b/src/modules/processing/services/reddit.js @@ -52,8 +52,8 @@ export default async function(obj) { let redditURL; let regularURL = "reddit.com"; let torURL = "reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion"; - if (torEnabled) redditURL = torURL - else redditURL = regularURL; + redditURL = regularURL; + if (global.torEnabled) redditURL = torURL; let twitterDispatcher; twitterDispatcher = false; diff --git a/src/modules/processing/services/twitter.js b/src/modules/processing/services/twitter.js index 9f9811bc..46235fef 100644 --- a/src/modules/processing/services/twitter.js +++ b/src/modules/processing/services/twitter.js @@ -9,8 +9,8 @@ export default async function(obj) { let twitterURL; let regularURL = "twitter.com"; let torURL = "twitter3e4tixl4xyajtrzo62zg5vztmjuricljdp2c5kshju4avyoid.onion"; - if (torEnabled) twitterURL = torURL - else twitterURL = regularURL; + twitterURL = regularURL; + if (global.torEnabled) twitterURL = torURL; let twitterDispatcher; twitterDispatcher = false; @@ -35,7 +35,7 @@ export default async function(obj) { dispatcher: twitterDispatcher, method: "POST", headers: _headers - }).then((r) => { return r.status === 200 ? r.json() : false }).catch((err) => { return false }); + }).then((r) => { return r.status === 200 ? r.json() : false }).catch(() => { return false }); if (!req_act) return { error: 'ErrorCouldntFetch' }; _headers["host"] = twitterURL;