X Quote Tweet Collapse
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
This script detects quote tweets in your X (Twitter) timelines, notification feeds, and individual tweet detail pages. When it finds a quote tweet, it collapses the embedded quoted tweet card behind a compact "Show quote" button, keeping only the quoting user's text and metadata visible. This dramatically reduces scrolling noise and lets you focus on the conversation context without being distracted by the nested quote content.
Click "Show quote" to expand an individual quote tweet and view its full content. Each quote tweet can be expanded or collapsed independently. The script also provides a global auto-collapse toggle that applies to all new quote tweets as they load via infinite scroll. For users who frequently expand certain quotes, the "remember expanded" option persists expanded states across page reloads using GM_setValue, so your preferred quotes stay open.
WHERE IT RUNS
The script runs on all X domains: twitter.com, *.twitter.com, x.com, and *.x.com. It works in the home timeline, notifications, search results, lists, and individual tweet detail pages. It handles dynamically loaded content via MutationObserver, so quote tweets that appear after scrolling, navigation, or page updates are processed automatically.
HOW TO USE
After installation, a settings panel appears on the left side of the screen with the gear emoji (⚙️). Open the panel to configure the script:
- Toggle "Auto-collapse quotes" on/off. When enabled, all newly loaded quote tweets are collapsed by default. When disabled, quote tweets load in their expanded state.
- Toggle "Remember expanded quotes" to persist individual expansion choices. When enabled, clicking "Show quote" on a tweet stores that preference, and the tweet remains expanded on future visits or page reloads.
Use the "Collapse all quotes" button to instantly collapse every expanded quote tweet visible on the current page. Use "Expand all quotes" to reveal all collapsed quote tweets at once. The "Reset all settings" button restores factory defaults and clears all remembered expansion states.
TECHNICAL SECTION — REAL MECHANISM
The script identifies quote tweets by locating articles with data-testid="tweet" and then traversing the DOM to find the nested quoted tweet container (also with data-testid="tweet" but marked as role="link"). It verifies quote status by checking for the presence of the socialContext indicator that X places on quote tweets. Once identified, the script stores the original display state of the quote card, then sets its display property to "none" to hide it. The toggle button is inserted after the quote indicator using raw DOM manipulation (appendChild/insertBefore), not innerHTML, to preserve event listeners and avoid security issues. All expansion states are stored with the tweet's numeric ID extracted from the status URL, using GM_setValue for persistent storage or an in-memory Map for session-only storage. The MutationObserver uses a debounced queue to batch processing, preventing performance degradation during rapid DOM updates.
THE PANEL
The settings panel is built with BotGentz's BGPanel component. It is draggable via its header, allowing you to reposition it anywhere on the screen. The panel snaps to the left edge by default but can be moved freely. Click the gear emoji to collapse the panel into a small bubble, and click the bubble to expand it again. The panel remembers its position per page session. Press the Escape key to quickly close or minimize the panel. The panel includes a status flash bar that provides visual feedback when settings are changed or actions are performed.
PLEASE NOTE
This script requires the free BotGentz browser extension to run. It does not function as a standalone Chrome extension and does not use chrome.* APIs. X/Twitter frequently updates its DOM structure, which may break the script's selectors. If quote tweets stop collapsing, please check for script updates. This script reads the page DOM to detect tweet elements and stores only numeric tweet IDs and boolean preference values via GM_setValue. No data is sent externally. The script never reads or writes password fields, hidden inputs, or file inputs. All DOM operations use safe methods (textContent, style properties, element cloning) to prevent XSS and injection vulnerabilities.