Created
April 18, 2020 22:46
-
-
Save slashinfty/3a499b71e45f18c9cfc02ab0423e6c4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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