Greasy Fork is available in English.

Unedit and Undelete for Reddit

Creates the option next to edited and deleted Reddit comments/posts to show the original comment from before it was edited

Autor
DenverCoder1
Installationen heute
7
Installationen gesamt
10.008
Bewertungen
26 3 5
Version
3.17.4
Erstellt am
20.07.2020
Letzte Aktualisierung
25.06.2023
Lizenz
MIT
Wird angewandt auf

Unedit and Undelete for Reddit

Dev Pro Tips Discussion & Support Server Issues Greasy Fork users Chrome Web Store users Firefox users

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.

How to use

instructions

Installation

Install with Greasy Fork Available in the Chrome Web Store Firefox Get the Add-on

As a Userscript

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 of showdown.min.js at the top of the script, just below the // ==/UserScript== line.

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/. 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.

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 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.

Changelog

Changes in 3.17.4

  • Refactored storage interface to use browser.storage.local or chrome.storage.local if available

Changes in 3.17.3

  • 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)

Changes in 3.17.2

  • Fixed an unsafe inline issue in Chrome from previous version (not released on Chrome)

Changes in 3.17.1

  • Fixed issue with headers not being passed when using Firefox
  • Added explicit variable declaration that was previously implicit
  • Minor refactoring

Changes in 3.17.0

  • Added support for Pushshift API token authentication

Changes in 3.16.4

  • Added link to r/pushshift issue post in fetch failed message
  • Added rounded corners for the original comment box

Changes in 3.16.3

  • 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

Changes in 3.16.2

  • 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

Changes in 3.16.1

  • 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

Changes in 3.16.0

  • Support for .compact Reddit layout
  • Show original links will not be shown if the post ID could not be determined

Changes in 3.15.1

  • Added some URL patterns to be excluded from running the script

Changes in 3.15.0

  • 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.

Changes in 3.14.0

  • Added support for [unavailable] comments and submissions (occurs when the user has been blocked by the author).

Changes in 3.13.0

  • 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).

Changes in 3.12.1

  • Hide link on edited submissions in Classic View since it does not display well (Reddit Redesign)

Changes in 3.12.0

  • 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

Changes in 3.11.0

  • 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

Changes in 3.10.0

  • 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

Changes in 3.9.5

  • Updated @​match for better compatibility

Changes in 3.9.4

  • 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

Changes in 3.9.3

  • Fix bug where the submission edited time appears more than once

Changes in 3.9.2

  • Fixed edited submissions when not using Reddit Enhancement Suite (RES is not a requirement)

Changes in 3.9.1

  • Support edited submissions in Firefox by using regex instead of URLPattern

Changes in 3.9.0

  • 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

Changes in 3.8.0

  • 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

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 (Old Reddit only)
  • 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)