Avoid excessive number of colored links on facebook
This commit is contained in:
parent
44a06eaaf5
commit
0e81571cf1
@ -320,7 +320,7 @@ function getIdentifierInternal(urlstr) {
|
|||||||
if (urlstr.classList && urlstr.classList.contains('time-ago')) return null;
|
if (urlstr.classList && urlstr.classList.contains('time-ago')) return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hostname == 'facebook.com') {
|
if (hostname == 'facebook.com' && urlstr.tagName) {
|
||||||
var parent = urlstr.parentElement;
|
var parent = urlstr.parentElement;
|
||||||
if (parent && (parent.tagName == 'H1' || parent.id == 'fb-timeline-cover-name')) {
|
if (parent && (parent.tagName == 'H1' || parent.id == 'fb-timeline-cover-name')) {
|
||||||
var id = getCurrentFacebookPageId();
|
var id = getCurrentFacebookPageId();
|
||||||
@ -328,6 +328,17 @@ function getIdentifierInternal(urlstr) {
|
|||||||
if (id)
|
if (id)
|
||||||
return 'facebook.com/' + id;
|
return 'facebook.com/' + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// comment timestamp
|
||||||
|
if (urlstr.firstChild && urlstr.firstChild.tagName == 'ABBR' && urlstr.lastChild == urlstr.firstChild) return null;
|
||||||
|
|
||||||
|
// post 'see more'
|
||||||
|
if (urlstr.classList.contains('see_more_link')) return null;
|
||||||
|
|
||||||
|
// post 'continue reading'
|
||||||
|
if (parent && parent.classList.contains('text_exposed_link')) return null;
|
||||||
|
|
||||||
|
|
||||||
if (urlstr.dataset) {
|
if (urlstr.dataset) {
|
||||||
var hovercard = urlstr.dataset.hovercard;
|
var hovercard = urlstr.dataset.hovercard;
|
||||||
if (hovercard) {
|
if (hovercard) {
|
||||||
@ -335,6 +346,16 @@ function getIdentifierInternal(urlstr) {
|
|||||||
if (id)
|
if (id)
|
||||||
return 'facebook.com/' + id;
|
return 'facebook.com/' + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// post Comments link
|
||||||
|
if (urlstr.dataset.testid == 'UFI2CommentsCount/root') return null;
|
||||||
|
|
||||||
|
// post Comments link
|
||||||
|
if (urlstr.dataset.commentPreludeRef) return null;
|
||||||
|
|
||||||
|
// page left sidebar
|
||||||
|
if (urlstr.dataset.endpoint) return null;
|
||||||
|
|
||||||
var gt = urlstr.dataset.gt;
|
var gt = urlstr.dataset.gt;
|
||||||
if (gt) {
|
if (gt) {
|
||||||
var gtParsed = JSON.parse(gt);
|
var gtParsed = JSON.parse(gt);
|
||||||
@ -342,8 +363,10 @@ function getIdentifierInternal(urlstr) {
|
|||||||
return 'facebook.com/' + gtParsed.engagement.eng_tid;
|
return 'facebook.com/' + gtParsed.engagement.eng_tid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var sigil = urlstr.dataset.sigil;
|
|
||||||
if (sigil) return null;
|
// comment interaction buttons
|
||||||
|
if (urlstr.dataset.sigil) return null;
|
||||||
|
|
||||||
var p = urlstr;
|
var p = urlstr;
|
||||||
while (p) {
|
while (p) {
|
||||||
var bt = p.dataset.bt;
|
var bt = p.dataset.bt;
|
||||||
@ -366,6 +389,9 @@ function getIdentifierInternal(urlstr) {
|
|||||||
}
|
}
|
||||||
if (url.protocol != 'http:' && url.protocol != 'https:') return null;
|
if (url.protocol != 'http:' && url.protocol != 'https:') return null;
|
||||||
|
|
||||||
|
// fb group member badge
|
||||||
|
if (url.pathname.includes('/badge_member_list/')) return null;
|
||||||
|
|
||||||
if (url.href.indexOf('http', 1) != -1) {
|
if (url.href.indexOf('http', 1) != -1) {
|
||||||
var s = getQuery(url.search);
|
var s = getQuery(url.search);
|
||||||
urlstr = null;
|
urlstr = null;
|
||||||
@ -393,6 +419,7 @@ function getIdentifierInternal(urlstr) {
|
|||||||
return getIdentifierInternal('http://' + match);
|
return getIdentifierInternal('http://' + match);
|
||||||
}
|
}
|
||||||
if (url.search && url.search.includes('http')) {
|
if (url.search && url.search.includes('http')) {
|
||||||
|
if (url.pathname.startsWith('/intl/')) return null; // facebook language switch links
|
||||||
for (var q of url.searchParams) {
|
for (var q of url.searchParams) {
|
||||||
if (q[1].startsWith('http')) return getIdentifierInternal(q[1]);
|
if (q[1].startsWith('http')) return getIdentifierInternal(q[1]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user