Skip to content

Instantly share code, notes, and snippets.

@paulirish
Created December 13, 2011 01:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulirish/1470003 to your computer and use it in GitHub Desktop.
Save paulirish/1470003 to your computer and use it in GitHub Desktop.
get gyazo hotlink quickly
@gth001
Copy link

gth001 commented Mar 19, 2023

Thanks! I modified it a little to put the link in the clipboard, and close the tab automatically (after 500ms since big uploads seem to break if its closed faster).

I'm pasting it here in case I ever lose it, since this is the first place google brings me for gyazo userscripts

// ==UserScript==
// @name gyazo direct links
// @version 1.0
// @description gyazo direct links
// @grant GM_setClipboard
// @grant window.close
// @match https://gyazo.com/*
// ==/UserScript==

if (/\/\/gyazo\.com\/[0-9a-zA-Z]{15}/.test(location.href)){
    var newLink = location.protocol + '//i.' + location.host + location.pathname + '.png';
    GM_setClipboard(newLink);
    await new Promise(r => setTimeout(r, 500));
    window.close(); //delete this line if you want to keep the tab open
    location.href = newLink;
}

@paulirish
Copy link
Author

@gth001 good stuff. :)

I'm pleased my script from December 2011 is still useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment