GetGyazoImage
code:1.0.js
// ==UserScript==
// @name GetGyazoImage
// @version 1.0
// @description try to take over the world!
// @author gosyujin
// @grant GM_xmlhttpRequest
// ==/UserScript==
unsafeWindow.get_gyazo_image = (gyazo_id) => {
const token = 'ここにGyazo Access Tokenを貼る';
const url = ${endpoint}${gyazo_id}?access_token=${token};
return new Promise((resolve, reject) => {
const method = "GET";
const onload = (res) => resolve(res);
GM_xmlhttpRequest({ method, url, onload, withCredentials: true });
});
}
GyazoのAPI(/images/:image)にアクセスしてレスポンスを返してもらう
UserScript(Scrapbox) > GetGyazoImage(Tampermonkey)でCORS制限を回避する 更新履歴
v1.0(2021/11/15)