From 9ffcd1c475a70092e02842ed162c7181f24436e0 Mon Sep 17 00:00:00 2001 From: shinigami-eyes <43276258+shinigami-eyes@users.noreply.github.com> Date: Sat, 26 Dec 2020 08:56:35 +0000 Subject: [PATCH] Don't allow labeling using a Facebook post link, since it will only contain the numeric ID of the page --- extension/content.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extension/content.ts b/extension/content.ts index 5978ac2..87c1126 100644 --- a/extension/content.ts +++ b/extension/content.ts @@ -499,6 +499,7 @@ function getIdentifierFromURLImpl(url: URL): string { const pathArray = url.pathname.split('/'); if (domainIs(host, 'facebook.com')) { + if (searchParams.get('story_fbid')) return null; const fbId = searchParams.get('id'); const p = url.pathname.replace('/pg/', '/'); const isGroup = p.startsWith('/groups/'); @@ -624,6 +625,8 @@ function getBadIdentifierReason(identifier: string, url: string, target: HTMLEle url.includes('/posts/') || url.includes('/photo/') || url.includes('/photo.php') || + url.includes('/permalink.php') || + url.includes('/permalink/') || url.includes('/photos/'))) return 'Only pages, users and groups can be labeled, not specific posts or photos.'; if (url.includes('wiki') && url.includes('#')) return 'Wiki paragraphs cannot be labeled, only whole articles.'; return null;