Derpibooru Download Fix

Restores Derpibooru download button

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 or Violentmonkey 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 Derpibooru Download Fix
// @namespace Violentmonkey Scripts
// @match *://derpibooru.org/*
// @description  Restores Derpibooru download button
// @author       novacrazy
// @version      0.0.1
// @license      MIT
// @grant none
// @run-at document-end
// ==/UserScript==

(function() {
  
  for(let e of document.getElementsByClassName("image-metabar")) {
    e.style.setProperty("width", "100%", "important");
    e.style.setProperty("max-width", "100%", "important");
  }
  
  for(let e of document.getElementsByClassName("flex--spaced-out")) {
    e.style.setProperty("justify-content", "normal", "important");
  }
 
  for(let dropdown of document.getElementsByClassName("dropdown block__header__dropdown-tab")) {
    let short = dropdown.children[0];

    // Filter out Galleries dropdown
    if(!short.href.endsWith('#')) {
      if(short.title.includes("Download")) {
        let long = dropdown.children[1].children[0];
        
        dropdown.innerHTML = `</i><div><a href=${long.href}><i class="fa fa-download"> Download</a></div>`;
      }
    }
  }
})();