gmfetch

A shim for using GM.xmlHttpRequest with a fetch-like API.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/422172/903521/gmfetch.js

Author
PotatoDiet
Version
1.0
Created
2021-02-22
Updated
2021-02-22
Size
760 Bytes
License
GPL-3.0

Usage

Metablock

@require https://greasyfork.org/scripts/422172-gmfetch/code/gmfetch.js
@grant   GM.xmlHttpRequest

Code

(async () => {
  // https://developer.mozilla.org/en-US/docs/Web/API/Response
  const res = await gmfetch("https://google.com");
  console.log(await res.text());
})();