Skip to content

etheralpha/twitter-screenshot-repost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

X Capture Quote

A WebExtension for Chrome and Firefox that adds a Capture option under X/Twitter's repost menu, below Quote.

When Capture is clicked, the extension:

  1. Closes/hides the repost menu so it does not appear in the screenshot.
  2. Scrolls the source post into capture position with a 75px top offset to avoid sticky banners.
  3. Captures the visible tab in memory.
  4. Crops the screenshot to the post border width and caps height at 2× the post width.
  5. Opens the overlay composer for a new post.
  6. Uploads the screenshot as media.

The extension popup has a toggle to turn the Capture menu option on or off. When off, Capture is removed from repost menus. When on, it appears again.

Browser support

  • Chrome / Chromium: use manifest.json.
  • Firefox: copy manifest.firefox.json over manifest.json before loading or packaging.

Firefox supports Manifest V3, but its background-script handling differs from Chrome in some versions. This repo includes a Firefox-specific manifest that uses background.scripts instead of Chrome's background.service_worker.

Install locally

Chrome / Chromium

  1. Open chrome://extensions.
  2. Enable Developer mode.
  3. Click Load unpacked.
  4. Select this folder.

Firefox

  1. Copy manifest.firefox.json to manifest.json.
  2. Open about:debugging#/runtime/this-firefox.
  3. Click Load Temporary Add-on.
  4. Select manifest.json.

Known limitations

X changes its DOM often, so selectors may need maintenance. The extension uses current accessibility labels and data-testid attributes where possible.

Browser extensions can capture the visible tab, not an arbitrary hidden page region. For longer posts, the extension scrolls the post into view, captures the visible viewport, then crops. If the post is taller than 2× its width, the crop is intentionally capped.

Programmatic media upload depends on X exposing an input[type=file] in the composer. If X blocks the synthetic file upload path, the extension falls back to copying the screenshot image to your clipboard and shows a toast telling you to paste it manually.

Files

  • manifest.json — Chrome MV3 manifest
  • manifest.firefox.json — Firefox MV3 manifest variant
  • background.js — browser screenshot bridge
  • content.js — X UI injection, capture, crop, composer automation
  • popup.html, popup.css, popup.js — extension popup with on/off toggle
  • icons/ — generated toolbar/extension icons

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors