mirror of
https://github.com/insin/control-panel-for-twitter.git
synced 2025-06-18 14:45:31 -04:00
Compare commits
7 Commits
5c79a93c36
...
8488436801
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8488436801 | ||
![]() |
6911f9143f | ||
![]() |
f686b671de | ||
![]() |
99a9af186b | ||
![]() |
571718faa9 | ||
![]() |
4be36de9f8 | ||
![]() |
8692f3f582 |
@ -4,7 +4,7 @@
|
||||
"name": "__MSG_extensionName__",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"homepage_url": "https://soitis.dev/control-panel-for-twitter",
|
||||
"version": "4.12.2",
|
||||
"version": "4.12.3",
|
||||
"icons": {
|
||||
"16": "icons/icon16.png",
|
||||
"32": "icons/icon32.png",
|
||||
@ -51,6 +51,7 @@
|
||||
],
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "{5cce4ab5-3d47-41b9-af5e-8203eea05245}",
|
||||
"strict_min_version": "121.0"
|
||||
},
|
||||
"gecko_android": {
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "__MSG_extensionName__",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"homepage_url": "https://soitis.dev/control-panel-for-twitter",
|
||||
"version": "4.12.2",
|
||||
"version": "4.12.3",
|
||||
"icons": {
|
||||
"16": "icons/icon16.png",
|
||||
"32": "icons/icon32.png",
|
||||
|
@ -793,7 +793,7 @@
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<div id="version">v4.12.2<span id="debugCountdown"></span></div>
|
||||
<div id="version">v4.12.3<span id="debugCountdown"></span></div>
|
||||
</form>
|
||||
<script src="options.js"></script>
|
||||
</body>
|
||||
|
@ -310,7 +310,7 @@ let $showBlueReplyFollowersCountLabel = /** @type {HTMLElement} */ (document.que
|
||||
//#region Utility functions
|
||||
function exportConfig() {
|
||||
let $a = document.createElement('a')
|
||||
$a.download = 'control-panel-for-twitter-v4.12.2.config.txt'
|
||||
$a.download = 'control-panel-for-twitter-v4.12.3.config.txt'
|
||||
$a.href = URL.createObjectURL(new Blob([
|
||||
JSON.stringify(optionsConfig, null, 2)
|
||||
], {type: 'text/plain'}))
|
||||
|
@ -640,7 +640,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 94;
|
||||
CURRENT_PROJECT_VERSION = 95;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = 2RDKJDLNY8;
|
||||
@ -661,7 +661,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MARKETING_VERSION = 4.12.2;
|
||||
MARKETING_VERSION = 4.12.3;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
@ -703,7 +703,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 94;
|
||||
CURRENT_PROJECT_VERSION = 95;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_TEAM = 2RDKJDLNY8;
|
||||
@ -718,7 +718,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MARKETING_VERSION = 4.12.2;
|
||||
MARKETING_VERSION = 4.12.3;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "__MSG_extensionName__",
|
||||
"description": "__MSG_extensionDescriptionShort__",
|
||||
"homepage_url": "https://soitis.dev/control-panel-for-twitter",
|
||||
"version": "4.12.2",
|
||||
"version": "4.12.3",
|
||||
"icons": {
|
||||
"48": "icon48.png",
|
||||
"96": "icon96.png",
|
||||
|
36
script.js
36
script.js
@ -8,7 +8,7 @@
|
||||
// @match https://x.com/*
|
||||
// @match https://mobile.x.com/*
|
||||
// @run-at document-start
|
||||
// @version 196
|
||||
// @version 197
|
||||
// ==/UserScript==
|
||||
void function() {
|
||||
|
||||
@ -1989,7 +1989,7 @@ const COMPOSE_TWEET_MODAL_PAGES = new Set([
|
||||
ModalPaths.GIF_SEARCH,
|
||||
])
|
||||
// <body> pseudo-selector for pages the full-width content feature works on
|
||||
const FULL_WIDTH_BODY_PSEUDO = ':is(.Community, .List, .HomeTimeline)'
|
||||
const FULL_WIDTH_BODY_PSEUDO = ':is(.Community, .List, .HomeTimeline, .Profile, .Tweet)'
|
||||
// Matches any notification count at the start of the title
|
||||
const TITLE_NOTIFICATION_RE = /^\(\d+\+?\) /
|
||||
// The Communities nav item takes you to /yourusername/communities
|
||||
@ -3020,7 +3020,7 @@ async function observeSidebar() {
|
||||
observeSearchForm()
|
||||
}
|
||||
// Process blue checks in the sidebar user box
|
||||
if (!config.hideSidebarContent) {
|
||||
if (!config.hideSidebarContent || config.showRelevantPeople && isOnIndividualTweetPage()) {
|
||||
void async function() {
|
||||
// Avoid false positive from Premium upsells in the sidebar
|
||||
let $aside = await getElement('aside[role="complementary"]:not(:has(a[href^="/i/premium"]))', {
|
||||
@ -3118,6 +3118,7 @@ async function observeSidebar() {
|
||||
}()
|
||||
}
|
||||
}, {
|
||||
leading: true,
|
||||
name:'sidebar container',
|
||||
observers: pageObservers,
|
||||
})
|
||||
@ -4158,6 +4159,10 @@ const configureCss = (() => {
|
||||
body.Sidebar${FULL_WIDTH_BODY_PSEUDO} ${Selectors.PRIMARY_COLUMN} > div:first-child > div:last-child {
|
||||
max-width: 990px;
|
||||
}
|
||||
/* Force full width on Profiles when sidebar is visible */
|
||||
body.Sidebar.Profile ${Selectors.PRIMARY_COLUMN} > div:first-child > div:last-child > div:first-child > div:first-child {
|
||||
max-width: unset;
|
||||
}
|
||||
/* Make the "What's happening" input keep its original width */
|
||||
body.HomeTimeline ${Selectors.PRIMARY_COLUMN} > div:first-child > div:nth-of-type(3) div[role="progressbar"] + div {
|
||||
max-width: 598px;
|
||||
@ -4177,6 +4182,10 @@ const configureCss = (() => {
|
||||
body:not(.Sidebar)${FULL_WIDTH_BODY_PSEUDO} ${Selectors.PRIMARY_COLUMN} > div:first-child > div:last-child {
|
||||
max-width: unset;
|
||||
}
|
||||
/* Force full width on Profiles when sidebar is not visible */
|
||||
body.not(.Sidebar).Profile ${Selectors.PRIMARY_COLUMN} > div:first-child > div:last-child > div:first-child > div:first-child {
|
||||
max-width: unset;
|
||||
}
|
||||
`)
|
||||
if (!config.fullWidthMedia) {
|
||||
// Make media & cards keep their original width
|
||||
@ -5449,8 +5458,6 @@ function onIndividualTweetTimelineChange($timeline, options) {
|
||||
let hiddenItemTypes = {}
|
||||
let processedCount = 0
|
||||
|
||||
/** @type {Element} */
|
||||
let $previousItem
|
||||
/** @type {?boolean} */
|
||||
let hidPreviousItem
|
||||
/** @type {boolean} */
|
||||
@ -5467,9 +5474,21 @@ function onIndividualTweetTimelineChange($timeline, options) {
|
||||
let $focusedTweet
|
||||
|
||||
for (let $item of $timeline.children) {
|
||||
if (seen.has($item)) {
|
||||
$previousItem = $item
|
||||
hidPreviousItem = seen.get($previousItem).hidden
|
||||
if (seen.has($item) &&
|
||||
// Reprocess Discover More Tweets if they were processed before the Discover More heading
|
||||
!(hideAllSubsequentItems && seen.get($item).hidden != config.hideMoreTweets)) {
|
||||
let details = seen.get($item)
|
||||
hidPreviousItem = details.hidden
|
||||
// The focused Tweet renders before any Tweets it was a reply to
|
||||
if (details.itemType == 'FOCUSED_TWEET') {
|
||||
changes = []
|
||||
hiddenItemCount = 0
|
||||
hiddenItemTypes = {}
|
||||
}
|
||||
// The Discover More heading renders after Discover more Tweets(?)
|
||||
else if (details.itemType == 'DISCOVER_MORE_HEADING') {
|
||||
hideAllSubsequentItems = config.hideMoreTweets
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
@ -5650,7 +5669,6 @@ function onIndividualTweetTimelineChange($timeline, options) {
|
||||
warn('unhandled timeline item', {$item, itemType, hideItem})
|
||||
}
|
||||
|
||||
$previousItem = $item
|
||||
hidPreviousItem = hideItem
|
||||
seen.set($item, {itemType, hidden: hideItem})
|
||||
processedCount++
|
||||
|
Loading…
Reference in New Issue
Block a user