twitter_to_nitter: fix regex

This commit is contained in:
Jesús
2020-01-09 12:06:53 -05:00
parent 364e32fe69
commit cbfcdff844

View File

@@ -29,7 +29,7 @@ let consoleCSS = 'background: #000; color: #00FF00; padding: 0px 7px; border: 1p
function rewriteLinks() {
for (let i = 0; i < document.links.length; i++) {
let elem = document.links[i];
if (elem.href.match(/http(s|)\:\/\/(mobile[.]|www[.]|)(twitter[.]com)\/([^&#]+.*$)/i)) {
if (elem.href.match(/http(s|):\/\/(mobile[.]|www[.]|)twitter[.]com\/(#!\/)?(.*$)/i)) {
elem.href='https://' + instance + '/' + RegExp.$4;
}
}