Skip to content

Commit

Permalink
fix(facebook): replace facebook tracking link with original link (DIY…
Browse files Browse the repository at this point in the history
  • Loading branch information
rayou authored May 8, 2021
1 parent 27240d9 commit b30fe4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/routes/facebook/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b30fe4a

Please sign in to comment.