Warning
Unedit and Undelete for Reddit relies on Pushshift to work.
At this time, Pushshift is only available to approved moderators as announced here.
Checking r/pushshift for updates is recommended.
June 22, 2023
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.
This script can be installed on 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.
Note: Some userscript engines such as Bromite and base Chromium do not support
@require
(see here). In order to get this userscript to work without a dedicated extension, you will need to copy-paste the contents ofshowdown.min.js
at the top of the script, just below the// ==/UserScript==
line.
Install from the Chrome Web Store, or alternatively, download or clone this repository, enable "Developer mode" at chrome://extensions/, and load the folder unpacked.
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/. Create a copy of .env.example
named .env
and replace the placeholders with your API key and secret. Install web-ext
with npm install -g web-ext
and sign the extension with make sign-firefox
. 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.
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 show "not found" since Pushshift can take some time to archive all comments.
- Comments in private subreddits will show "not found" as they are not able to be archived by Pushshift.
- Comments deleted by Reddit's spam filter will show "not found" as the text is never available for Pushshift to archive.
- Comments and posts by users who have requested the deletion of the data from Pushshift will show as "not found".
- If the Pushshift API is temporarily down or partially down, the message "fetch failed" may appear.
- Refactored storage interface to use
browser.storage.local
orchrome.storage.local
if available
- Make inline fetch fix only apply to Firefox
- Store hidden state of token container so it is hidden if previously closed (will reopen if token is used and is invalid)
Fixed an unsafe inline issue in Chrome from previous version (not released on Chrome)
- Fixed issue with headers not being passed when using Firefox
- Added explicit variable declaration that was previously implicit
- Minor refactoring
- Added support for Pushshift API token authentication
- Added link to r/pushshift issue post in fetch failed message
- Added rounded corners for the original comment box
- Added support for
[ Removed by Reddit ]
comments in moderator view - Added icon to Userscript metadata
- Added more error handling for Pushshift API issues
- Prevent class names from being added to user flairs on old Reddit
- Updated manifest v2 permissions list for Firefox 109 support
- Added version number to startup logs
- Remove title text from appearing in parentheses for RES users
- Removed sort order parameters due to recent breaking changes in the Pushshift API
- Added title text to show original links and error links to show additional information when hovering over them
- Support for .compact Reddit layout
- Show original links will not be shown if the post ID could not be determined
- Added some URL patterns to be excluded from running the script
- Added support for comments not shown in the comment tree if the link is visited directly.
- Added missing
showdown.min.js.map
file to/vendor
to avoid Source Map error (Browser Extension only). - Avoids sending queries with the author being undefined, and checks the parent post if the author is not known.
- Ensure initialization runs even if the window finishes loading before the extension is loaded.
- Added support for
[unavailable]
comments and submissions (occurs when the user has been blocked by the author).
- Added support for Classic view and Compact view on Reddit Redesign.
- Adjusted the font size of links on the search results page to be smaller (Reddit Redesign).
- Hide link on edited submissions in Classic View since it does not display well (Reddit Redesign)
- Added support to show the author of posts that were not edited but the author no longer exists
- Added support for edited submissions on comment context pages
- Ensure the original post fills the available space on Reddit Redesign
- Fix markdown conversion to include strikethrough, Github-style code blocks, indented sublists without 4 spaces, and underscores in the middle of a word
- Added links wherever username and subreddit mentions appear in the original post
- Added support for hiding spoiler text in the original post
- Added support for superscripts using
^
in the original post - Fixed the search results page on Reddit Redesign to only show the link once
- Fixed fetching edited submissions sometimes failing
- Added color overrides for compatibility with RES Night Mode and more custom CSS themes on Old Reddit
- Added extra spacing around paragraphs and headings in the original comment
- Improved styling of code blocks in the original comment on Reddit Redesign
- Added support for displaying tables in the original comment
- Updated @match for better compatibility
- Added the author and created time at the bottom of the original comment. This helps to find out who posted a deleted comment.
- Fix showing of empty self-text of a post when it was empty and then edited to have text
- Updates to the color of links in the original post on Redesign to be easier to read
- Prevents the original post from being displayed more than once if "show original" links are clicked multiple times
- Fix bug where the submission edited time appears more than once
- Fixed edited submissions when not using Reddit Enhancement Suite (RES is not a requirement)
- Support edited submissions in Firefox by using regex instead of
URLPattern
- Support for edited submissions on Reddit Redesign on submission pages, list view, and popup view
- Displays how long ago submissions were edited on Redesign since Reddit doesn't display this information
- Minor code refactoring and added comments
- Added support for viewing deleted and moderator-removed submissions on Redesign and Old Reddit
- Added support for viewing edited submissions in list views (Old Reddit only)
- Better error handling and logging
- Changed background and foreground color of original posts to be consistent across all posts and themes
- Made "Original Post" heading bold on Redesign for consistency
- Fix duplicate "Show Original" links appearing inside deleted comments
- 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 (Old Reddit only)
- Some minor code refactoring and formatting
- Fixed positioning of original comment on Old Reddit to be inline with text rather than below replies
- Added support for viewing comments removed by moderators
- Better error handling
- More reliable when viewing edited comments on profile pages
- 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
- Added compatibility with Old Reddit links without "old.reddit" in the URL
- Added additional @includes for more compatibility
- Fixed @match for more compatibility
- Added support for profile pages (Redesign)
- Works more accurately in post previews (Redesign feature where the post is shown in a popup when clicked from post list)
- 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
- Added support for deleted comments
- The original comment is converted from markdown to HTML to show custom formatting
- Support for self-text submissions (old Reddit only)