|
|
@@ -206,6 +206,19 @@ function {{JS_PREFIX}}_should_block(blocked_users, article) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
function {{JS_PREFIX}}_remove_param(href, param) { |
|
|
|
const cid = href.indexOf(param+'='); |
|
|
|
if (cid !== -1) { |
|
|
|
const regex = new RegExp('&?'+param+'=[^?&]+', 'g'); |
|
|
|
href = href.replace(regex, ''); |
|
|
|
const qPos = href.indexOf('?'); |
|
|
|
if (href[qPos+1] === '&') { |
|
|
|
href = href.substring(0, qPos) + href.substring(qPos+2); |
|
|
|
} |
|
|
|
} |
|
|
|
return href; |
|
|
|
} |
|
|
|
|
|
|
|
function {{JS_PREFIX}}_apply_blocks(blocked_users) { |
|
|
|
|
|
|
|
const mobile = {{JS_PREFIX}}_mobile; |
|
|
@@ -223,5 +236,23 @@ function {{JS_PREFIX}}_apply_blocks(blocked_users) { |
|
|
|
if (authorName) { |
|
|
|
{{JS_PREFIX}}_remove_article(article, authorName === true ? null : authorName); |
|
|
|
} |
|
|
|
Array.from(article.getElementsByTagName('a')).forEach(a => { |
|
|
|
let href = a.href; |
|
|
|
if (href.indexOf('facebook.com') !== -1 && href.indexOf('u=http') !== -1) { |
|
|
|
const uPos = href.indexOf('u=http'); |
|
|
|
const andPos = href.indexOf('&'); |
|
|
|
if (andPos !== -1) { |
|
|
|
href = href.substring(uPos + 2, andPos); |
|
|
|
} else { |
|
|
|
href = href.substring(uPos + 2); |
|
|
|
} |
|
|
|
href = decodeURIComponent(href); |
|
|
|
} |
|
|
|
href = {{JS_PREFIX}}_remove_param(href, 'fbclid'); |
|
|
|
href = {{JS_PREFIX}}_remove_param(href, '_ft_'); |
|
|
|
href = {{JS_PREFIX}}_remove_param(href, '__tn__'); |
|
|
|
href = {{JS_PREFIX}}_remove_param(href, 'refid'); |
|
|
|
a.href = href; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |