fix(facebook): replace facebook tracking link with original link (#7460)

This commit is contained in:
rayou
2021-05-09 08:13:55 +10:00
committed by GitHub
parent 27240d9bfd
commit b30fe4a43c

View File

@@ -24,6 +24,13 @@ const parseStoryPage = async (linkPath, cache) => {
const $box = $story.find('div > div > div > div').eq(0);
const $header = $box.find('header').eq(0);
const $content = $box.find('div > div').eq(0);
$content.find('a[href^="https://lm.facebook.com/l.php"]').each((_, ele) => {
const link = $(ele);
const originalLink = new URL(link.attr('href')).searchParams.get('u');
if (originalLink) {
link.attr('href', decodeURIComponent(originalLink));
}
});
const $attach = $story.find('div > div > div > div:nth-child(3)').eq(0);
const attachLinkList = $attach