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://greasyfork.org/scripts/422172-gmfetch/code/gmfetch.js?version=903521

Author
PotatoDiet
Ratings
0 0 0
Version
1.0
Created
2021-02-22
Updated
2021-02-22
License
GPL-3.0
Applies to
All sites

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());
})();