Tweetdeck: add logic to update myself

This commit is contained in:
eater 2019-12-20 15:08:49 +01:00
parent 77c45eb48b
commit 64a590ed38

View File

@ -315,11 +315,20 @@ function initTweetdeckOtherRepliesLink(a: HTMLAnchorElement) {
} }
function initLink(a: HTMLAnchorElement) { function initLink(a: HTMLAnchorElement) {
if (hostname === 'tweetdeck.twitter.com' && a.classList.contains('other-replies-link')) { if (hostname === 'tweetdeck.twitter.com') {
if (a.classList.contains('other-replies-link')) {
initTweetdeckOtherRepliesLink(a); initTweetdeckOtherRepliesLink(a);
return; return;
} }
// js-account-summary contains the link to profile
// We can use this to update `myself`
if (a.parentElement.classList.contains("js-account-summary") && a.dataset.userName) {
myself = `twitter.com/${a.dataset.userName}`;
return;
}
}
var identifier = getIdentifier(a); var identifier = getIdentifier(a);
if (!identifier) { if (!identifier) {
if (hostname == 'youtube.com' || hostname == 'twitter.com') if (hostname == 'youtube.com' || hostname == 'twitter.com')