Post Peek: A Chrome Extension for Focused Twitter Post Viewing
Read X posts in a popup without visiting the full site.
1Introduction to Post Peek
Post Peek is a Chrome extension designed to enhance the user experience on X (formerly Twitter). It allows users to view individual posts in a popup window without navigating away from their current page. Inspired by Litterbox, a Safari extension, Post Peek offers similar functionality for Chrome users. The extension is open-source and prioritizes user privacy by not sending cookies or referrer data to X. This means users can read posts anonymously, without X tracking their activity. The project is independent and not affiliated with X Corp or the original Litterbox developers.
2How Post Peek Works
Post Peek intercepts clicks on x.com and twitter.com links, opening them in a popup instead of redirecting to the full site. It marks openable links with a small blue dot for easy identification. The extension renders text, photos, videos, link cards, quoted posts, and reply context within the popup. It fetches posts from X's public syndication endpoint, the same API used for embedded posts on other websites. This ensures compatibility and reliability. Users can close the popup with the Esc key or by clicking outside it, returning to their original page seamlessly.
3Privacy Features
Post Peek is built with privacy in mind. It never sends cookies or a Referer header to X, ensuring that your account activity remains private. Posts and media are fetched anonymously, so X cannot link your browsing activity to your account. The extension does not scan the page or interact with links beyond the one clicked. The blue dot marker is pure CSS, and no web-accessible resources are used. Settings are stored locally on your device (chrome.storage.local) and are never synced. The project includes a detailed PRIVACY.md file outlining its data handling practices.
4Installation and Usage
Post Peek can be installed from the Chrome Web Store, ensuring users get the reviewed and up-to-date build. For developers, the extension can be loaded unpacked from the chrome://extensions page. Once installed, clicking a post link opens it in a popup. Holding Ctrl, Shift, Alt, or middle-clicking opens the link normally. The toolbar button allows users to toggle peeking, the dot marker, and the popup theme. Quoted posts and 'Replying to' context open in the same popup, maintaining a consistent user experience.
5Development and Building
Post Peek is an open-source project hosted on GitHub. Developers can build the extension for the Chrome Web Store using npm run build, which generates a dist/post-peek-version.zip file. The build includes only runtime files like manifest.json, src/, options/, and icons/. Artwork can be regenerated using npm run icons for extension icons and npm run media for banners and screenshots. The release process involves updating CHANGELOG.md, bumping the version in manifest.json and package.json, and tagging the release on GitHub. The same zip file is uploaded to the Chrome Web Store.
6Technical Details
The extension uses a Manifest V3 (MV3) architecture. src/background.js handles fetching posts from cdn.syndication.twimg.com and proxying images when a page's CSP blocks twimg.com. src/content.js intercepts clicks on post links and renders the popup within a closed Shadow DOM. src/content.css styles the dot marker, matched purely on the link's href. src/popup-css.js embeds the popup stylesheet as a string to avoid web-accessible resources. The options/ directory contains the settings page, which also serves as the toolbar popup. scripts/ includes tools for icon generation and README artwork rendering.
7Testing and Quality Assurance
Post Peek includes dependency-free tests for packaging and privacy invariants, run with npm test. The test.html page provides a set of links for manual testing of dot markers and peeking functionality in the browser. The extension deliberately does not run on file:// pages, ensuring security. Developers can serve the folder over HTTP (e.g., using python -m http.server 8000) and open http://localhost:8000/test.html for testing. The project emphasizes maintaining privacy and functionality invariants, with tests ensuring these are not broken during development.
8Credit and Inspiration
Post Peek was inspired by Litterbox, a Safari extension by Zhenyi Tan (And a Dinosaur). Litterbox pioneered the idea of opening x.com links in a popup, marking handleable links, and using X's public API for anonymous post fetching. Post Peek's blue dot marker and name are nods to Litterbox's design. However, Post Peek is a separate, from-scratch implementation for Chrome and is not affiliated with Litterbox or its developers. The extension is open-source, allowing the community to contribute and report issues, ensuring transparency and continuous improvement.
Original article: Daring Fireball — Post Peek: A Chrome Extension for Focused Twitter Post Viewing