Unedit and Undelete for Reddit
Creates a link next to edited and deleted Reddit comments and submissions to show the original post from before it was edited/removed.
The unedited comment will be displayed inline, right below the current comment or submission's text.
This script is compatible with both Reddit's Redesign and Old Reddit.
The Pushshift Reddit API is used for fetching the comments as they will be archived soon after they have been posted.
How to use

Installation

As a Userscript
This script can be installed to most browsers using userscript browser extensions such as Violentmonkey, Tampermonkey, among others using the green button on Greasy Fork镜像.
Alternatively, you may copy the contents of script.js
into a new script using any userscript browser extension.
As a Chrome Extension
Install from the Chrome Web Store, or alternatively, download or clone this repository, enable "Developer mode" at chrome://extensions/, and load the folder unpacked.
As a Firefox Addon
Install from Mozilla Add-ons, or alternatively, follow these steps to build and install from the source:
To sign the extension for use in Firefox, you will need credentials from https://addons.mozilla.org/en-US/developers/addon/api/key/. The generated extension will appear as a .xpi
file in ./web-ext-artifacts
. This file can be opened in Firefox to install the add-on.
# Install the web-ext CLI
npm install -g web-ext
# web-ext only supports manifest v2 as of now
mv manifest.json manifest-v3.json && mv manifest-v2.json manifest.json
# Sign and generate the add-on using credentials
web-ext sign --api-key=user:YOUR_USER_ID --api-secret=YOUR_SECRET
Known issues
The following are known limitations that cannot be fixed:
- The fetched comment may occasionally be the edited version instead of the original. This is because the Pushshift archive may take more time to archive the comment than it took the user to edit the comment, therefore causing Pushshift to archive the edited version and not the original. Additionally, comments that are several years old may also show the edited version since the original versions of comments edited before the first archival will not appear in Pushshift.
- Comments that were posted within the past few minutes may occasionally not be found since Pushshift can take some time to archive all comments.
- Comments in private subreddits will not be found as they are not able to be archived by Pushshift.
Changelog
Changes in 3.7.3
- Fix duplicate "Show original" links appearing inside deleted comments
Changes in 3.7.2
- Prevent "show original" links from appearing twice on comments that are both edited and deleted
- Expand comment when the "show original" link is clicked on a collapsed comment
- Some minor code refactoring and formatting
Changes in 3.7.1
- Fixed positioning of original comment on Old Reddit to be inline with text rather than below replies
Changes in 3.7.0
- Added support for viewing comments removed by moderators
Changes in 3.6.1
- Better error handling
- More reliable when viewing edited comments on profile pages
Changes in 3.6.0
- Check a second source for comments so more recent comments are less likely to be "not found"
- Fixes to getting comment ids in Reddit redesign
Changes in 3.5
- Added compatibility with Old Reddit links without "old.reddit" in the URL
- Added additional @includes for more compatibility
Changes in 3.4
- Fixed @match for more compatibility
Changes in 3.3
- Added support for profile pages (Redesign)
Changes in 3.2
- Works more accurately in post previews (Redesign feature where the post is shown in a popup when clicked from post list)
Changes in 3.1
- Fixed missing styling on comments shown in the Redesign
- Fixed placement of inline comment to work on comments that do not end with a paragraph (
<p>
) element
Changes in 3.0
- Added support for deleted comments
Changes in 2.0
- The original comment is converted from markdown to HTML to show custom formatting
- Support for self-text submissions (old Reddit only)