Gyazo Redirector

Redirects gyazo.com -> i.gyazo.com

// ==UserScript==
// @name        Gyazo Redirector
// @author      brian6932
// @namespace   https://greasyfork.org/users/581142
// @namespace   https://github.com/brian6932
// @license     agpl-3.0-only
// @description Redirects gyazo.com -> i.gyazo.com
// @include     /^ht{2}ps:\/{2}gyazo\.com\/[\da-f]+$/
// @grant       GM_xmlhttpRequest
// @run-at      document-start
// @version     1.2
// jshint esversion: 11
// ==/UserScript==

GM_xmlhttpRequest({
	url: `https://api.gyazo.com/api/oembed?url=` + location.href,
	responseType: `json`,
	onload: _ => location.href = _.response.url ?? (() => { throw Error(`OEmbed request failed`) })()
})