add support for Tweetdeck
This commit is contained in:
@ -51,6 +51,13 @@ function fixupSiteStyles() {
|
|||||||
.stream-item a:active .fullname
|
.stream-item a:active .fullname
|
||||||
{color:inherit;}
|
{color:inherit;}
|
||||||
`);
|
`);
|
||||||
|
} else if (hostname === 'tweetdeck.twitter.com') {
|
||||||
|
let profile: null|HTMLElement = (<HTMLElement>document.querySelector('.js-account-summary [rel=user]'));
|
||||||
|
let handle: null|String = profile ? profile.dataset.userName : null;
|
||||||
|
|
||||||
|
if (handle) {
|
||||||
|
myself = 'twitter.com/' + handle;
|
||||||
|
}
|
||||||
} else if (hostname == 'reddit.com') {
|
} else if (hostname == 'reddit.com') {
|
||||||
myself = getIdentifier(<HTMLAnchorElement>document.querySelector('#header-bottom-right .user a'));
|
myself = getIdentifier(<HTMLAnchorElement>document.querySelector('#header-bottom-right .user a'));
|
||||||
if (!myself) {
|
if (!myself) {
|
||||||
@ -88,6 +95,7 @@ function init() {
|
|||||||
'youtube.com',
|
'youtube.com',
|
||||||
'reddit.com',
|
'reddit.com',
|
||||||
'twitter.com',
|
'twitter.com',
|
||||||
|
'tweetdeck.twitter.com',
|
||||||
'medium.com',
|
'medium.com',
|
||||||
'disqus.com',
|
'disqus.com',
|
||||||
'rationalwiki.org',
|
'rationalwiki.org',
|
||||||
@ -104,7 +112,7 @@ function init() {
|
|||||||
setInterval(updateYouTubeChannelHeader, 300);
|
setInterval(updateYouTubeChannelHeader, 300);
|
||||||
setInterval(updateAllLabels, 6000);
|
setInterval(updateAllLabels, 6000);
|
||||||
}
|
}
|
||||||
if (hostname == 'twitter.com') {
|
if (hostname == 'twitter.com' || hostname == 'tweetdeck.twitter.com') {
|
||||||
setInterval(updateTwitterClasses, 800);
|
setInterval(updateTwitterClasses, 800);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,8 +402,9 @@ function getIdentifierFromElementImpl(element: HTMLAnchorElement): string {
|
|||||||
p = p.parentElement;
|
p = p.parentElement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (hostname == 'twitter.com') {
|
} else if (hostname == 'twitter.com' || hostname == 'tweetdeck.twitter.com') {
|
||||||
if (dataset && dataset.expandedUrl) return getIdentifier(dataset.expandedUrl);
|
if (dataset && dataset.expandedUrl) return getIdentifier(dataset.expandedUrl);
|
||||||
|
if (dataset && dataset.fullUrl) return getIdentifier(dataset.expandedUrl);
|
||||||
if (element.href.startsWith('https://t.co/')) {
|
if (element.href.startsWith('https://t.co/')) {
|
||||||
const title = element.title;
|
const title = element.title;
|
||||||
if (title && (title.startsWith('http://') || title.startsWith('https://')))
|
if (title && (title.startsWith('http://') || title.startsWith('https://')))
|
||||||
|
Reference in New Issue
Block a user