Fixes #135 - Handle Twitter usernames with "tweets" in them.
This commit is contained in:
parent
01e986fce3
commit
f714c666d9
|
@ -290,7 +290,7 @@ function redirectTwitter(url, initiator) {
|
||||||
if (disableNitter || isException(url, initiator)) {
|
if (disableNitter || isException(url, initiator)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (url.pathname.includes("/home")) {
|
if (url.pathname.split("/").includes("home")) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
@ -313,7 +313,7 @@ function redirectTwitter(url, initiator) {
|
||||||
return `${
|
return `${
|
||||||
nitterInstance || commonHelper.getRandomInstance(nitterRandomPool)
|
nitterInstance || commonHelper.getRandomInstance(nitterRandomPool)
|
||||||
}/gif/${encodeURIComponent(url.href)}`;
|
}/gif/${encodeURIComponent(url.href)}`;
|
||||||
} else if (url.pathname.includes("tweets")) {
|
} else if (url.pathname.split("/").includes("tweets")) {
|
||||||
return `${
|
return `${
|
||||||
nitterInstance || commonHelper.getRandomInstance(nitterRandomPool)
|
nitterInstance || commonHelper.getRandomInstance(nitterRandomPool)
|
||||||
}${url.pathname.replace("/tweets", "")}${url.search}`;
|
}${url.pathname.replace("/tweets", "")}${url.search}`;
|
||||||
|
@ -379,7 +379,7 @@ function redirectGoogleMaps(url, initiator) {
|
||||||
layers[url.searchParams.get("layer")] || layers["none"]
|
layers[url.searchParams.get("layer")] || layers["none"]
|
||||||
}`;
|
}`;
|
||||||
// Handle Google Maps Embed API
|
// Handle Google Maps Embed API
|
||||||
if (url.pathname.includes("/embed")) {
|
if (url.pathname.split("/").includes("embed")) {
|
||||||
let query = "";
|
let query = "";
|
||||||
if (url.searchParams.has("q")) {
|
if (url.searchParams.has("q")) {
|
||||||
query = url.searchParams.get("q");
|
query = url.searchParams.get("q");
|
||||||
|
@ -400,7 +400,7 @@ function redirectGoogleMaps(url, initiator) {
|
||||||
});
|
});
|
||||||
redirect = `${osmInstance}/export/embed.html?bbox=${bbox}&layer=mapnik&marker=${marker}`;
|
redirect = `${osmInstance}/export/embed.html?bbox=${bbox}&layer=mapnik&marker=${marker}`;
|
||||||
// Handle Google Maps Directions
|
// Handle Google Maps Directions
|
||||||
} else if (url.pathname.includes("/dir")) {
|
} else if (url.pathname.split("/").includes("dir")) {
|
||||||
const travelMode =
|
const travelMode =
|
||||||
travelModes[url.searchParams.get("travelmode")] || travelModes["driving"];
|
travelModes[url.searchParams.get("travelmode")] || travelModes["driving"];
|
||||||
let origin;
|
let origin;
|
||||||
|
|
Loading…
Reference in New Issue