Skip to content

Instantly share code, notes, and snippets.

@slashinfty
Created April 18, 2020 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slashinfty/3a499b71e45f18c9cfc02ab0423e6c4a to your computer and use it in GitHub Desktop.
Save slashinfty/3a499b71e45f18c9cfc02ab0423e6c4a to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Giphy Download GIF
// @version 1.0.1
// @description Allows you to download GIFs direcly from GIPHY
// @author slashinfty (originally by Yoshitura)
// @match https://*.giphy.com/gifs/*
// @match http://*.giphy.com/gifs/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
var orig_url = window.location.pathname.split('/');
var gif_url = (/(\d|\w)[^-]*$/).exec(orig_url[2])[0];
var download_button = document.createElement('div');
download_button.setAttribute('style','position:absolute;left:0;top:0;margin:5px;');
download_button.innerHTML = "<a download style='text-decoration:none;color:#FFFFFF;' href='https://i.giphy.com/"+gif_url+".gif'>DOWNLOAD GIF</a>";
document.body.appendChild(download_button);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment