mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-19 19:58:28 +00:00
only hide "paste clipboard" button for Firefox Tor users
This commit is contained in:
parent
a4c8eff71a
commit
197c1dc0e6
@ -344,9 +344,9 @@ function resetSettings() {
|
|||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
window.location.reload();
|
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() {
|
async function pasteClipboard() {
|
||||||
if (window.location.hostname.endsWith(".onion")) return
|
if (window.location.hostname.endsWith(".onion") && !(navigator.getBattery())) return
|
||||||
try {
|
try {
|
||||||
let t = await navigator.clipboard.readText();
|
let t = await navigator.clipboard.readText();
|
||||||
if (regex.test(t)) {
|
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("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 ((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;
|
if (sGet("disableMetadata") === "true") req.disableMetadata = true;
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ export default async function(obj) {
|
|||||||
let redditURL;
|
let redditURL;
|
||||||
let regularURL = "reddit.com";
|
let regularURL = "reddit.com";
|
||||||
let torURL = "reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion";
|
let torURL = "reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion";
|
||||||
if (torEnabled) redditURL = torURL
|
redditURL = regularURL;
|
||||||
else redditURL = regularURL;
|
if (global.torEnabled) redditURL = torURL;
|
||||||
|
|
||||||
let twitterDispatcher;
|
let twitterDispatcher;
|
||||||
twitterDispatcher = false;
|
twitterDispatcher = false;
|
||||||
|
@ -9,8 +9,8 @@ export default async function(obj) {
|
|||||||
let twitterURL;
|
let twitterURL;
|
||||||
let regularURL = "twitter.com";
|
let regularURL = "twitter.com";
|
||||||
let torURL = "twitter3e4tixl4xyajtrzo62zg5vztmjuricljdp2c5kshju4avyoid.onion";
|
let torURL = "twitter3e4tixl4xyajtrzo62zg5vztmjuricljdp2c5kshju4avyoid.onion";
|
||||||
if (torEnabled) twitterURL = torURL
|
twitterURL = regularURL;
|
||||||
else twitterURL = regularURL;
|
if (global.torEnabled) twitterURL = torURL;
|
||||||
|
|
||||||
let twitterDispatcher;
|
let twitterDispatcher;
|
||||||
twitterDispatcher = false;
|
twitterDispatcher = false;
|
||||||
@ -35,7 +35,7 @@ export default async function(obj) {
|
|||||||
dispatcher: twitterDispatcher,
|
dispatcher: twitterDispatcher,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: _headers
|
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' };
|
if (!req_act) return { error: 'ErrorCouldntFetch' };
|
||||||
|
|
||||||
_headers["host"] = twitterURL;
|
_headers["host"] = twitterURL;
|
||||||
|
Loading…
Reference in New Issue
Block a user