regard x.com as twitter in MkUrlPreview.vue

This commit is contained in:
naskya 2023-08-18 22:27:57 +00:00
parent e25e2ecb68
commit 58d5b76edb

View file

@ -139,8 +139,7 @@ if (!["http:", "https:"].includes(requestUrl.protocol))
throw new Error("invalid url"); throw new Error("invalid url");
if ( if (
requestUrl.hostname === "twitter.com" || ["twitter.com", "mobile.twitter.com", "x.com"].includes(requestUrl.hostname)
requestUrl.hostname === "mobile.twitter.com"
) { ) {
const m = requestUrl.pathname.match(/^\/.+\/status(?:es)?\/(\d+)/); const m = requestUrl.pathname.match(/^\/.+\/status(?:es)?\/(\d+)/);
if (m) tweetId.value = m[1]; if (m) tweetId.value = m[1];