From 1aa47f4b0d2e9b37f601301664ffb7f7373fd2ee Mon Sep 17 00:00:00 2001 From: eater <=@eater.me> Date: Fri, 20 Dec 2019 13:23:17 +0100 Subject: [PATCH] Fix twitter self resolving --- extension/content.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/extension/content.ts b/extension/content.ts index 7278751..42a1fb1 100644 --- a/extension/content.ts +++ b/extension/content.ts @@ -37,7 +37,15 @@ function fixupSiteStyles() { .assigned-label-t-friendly { outline: 1px solid var(--ShinigamiEyesTFriendly) !important; } `); } else if (hostname == 'twitter.com') { - myself = getIdentifier(document.querySelector('.DashUserDropdown-userInfo a')); + let profileLink = document.querySelector('.DashUserDropdown-userInfo a'); + if (profileLink == null) { + // If no profile link could be found via the old resolver, the user is most likely using the new twitter style + // Which includes a lot of obfuscation, so use aria hinting to resolve it + profileLink = document.querySelector('nav[aria-label="Primary"] [aria-label="Profile"][role="link"]') + } + + myself = getIdentifier(profileLink); + addStyleSheet(` .pretty-link b, .pretty-link s { color: inherit !important;