fetch pollyfill using GM_xmlhttpRequest
이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greasyfork.org/scripts/421384/1134973/GM_fetch.js을(를) 사용하여 포함하는 라이브러리입니다.
fetch pollyfill using GM_xmlhttpRequest, not yet 100% replication of fetch API (eg. errors)
Don't forget to add permissions
// @grant GM_xmlhttpRequest
// @connect api.example.com
Example
GM_fetch("https://api.example.com/favicon.png", {
method: 'POST',
body: JSON.stringify({message: "hello world"}),
headers: { 'Content-Type': 'application/json' }
}).then(resp=>resp.blob()).then(blob=>{
open(URL.createObjectURL(blob), "_blank")
})