RedditSave button (old reddit)

created on 2022-06-12, 12:35:31 a.m.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        RedditSave button (old reddit)
// @namespace   Violentmonkey Scripts
// @match       https://old.reddit.com/*
// @grant       none
// @version     1.0
// @author      thismoon
// @description created on 2022-06-12, 12:35:31 a.m.
// @license     GNU GPLv3
// ==/UserScript==
buttons = document.querySelectorAll('[data-kind="video"] > .entry > .top-matter > .flat-list, [data-kind="gif"] > .entry > .top-matter > .flat-list');
Array.prototype.forEach.call( buttons, function( node ) {
      //node.parentNode.removeChild( node );
      //node.style.opacity = 0.5;

      //create the button

      //const post = node.parentNode
      //const url = post.querySelector('.title > a').getAttribute("href");
      //const saveurl = 'https://redditsave.com' + url;
      const url = node.querySelector('.comments').getAttribute("href").replace("old.reddit", "redditsave");
      const savebtn = document.createElement("li");
      const link = document.createElement("a");
      //link.href = saveurl;
      link.href = url;
      link.target = "_blank";
      link.rel = "noreferrer noopener";
      savebtn.appendChild(link);

      const textnode = document.createTextNode("redditsave");
      link.appendChild(textnode);




      node.appendChild(savebtn);
});