Change String#match to RegExp#exec

This commit is contained in:
jbmagination 2023-11-05 12:13:24 -05:00
parent 82523bffc8
commit fc3e4841b0

View File

@ -28,7 +28,7 @@ export default function (inHost, inURL) {
host = "twitter";
url = url.replace("https://fixvx.com/", "https://twitter.com/")
}
if (url.match(/^https:\/\/(d\.|dl\.|)(fxtwitter|twittpr|fixupx).com\//g)) {
if (/^https:\/\/(d\.|dl\.|)(fxtwitter|twittpr|fixupx).com\//g.test(url)) {
host = "twitter";
url = url.replace(url.match(/^https:\/\/(d\.|dl\.|)(fxtwitter|twittpr|fixupx).com\//g)[0], "https://twitter.com/")
if (url.endsWith(".mp4")) url = url.replace(".mp4", "")