A fetch-like polyfill for userscript managers (Tampermonkey, Greasemonkey, Violentmonkey). Version 0.1.2 provides a familiar `fetch` interface over `GM_xmlhttpRequest`, allowing userscript authors to use Promise-based HTTP requests without managing raw GM API calls. Lightweight, no external dependencies, supports typical fetch options (method, headers, body). Key differentiator: simplifies migrating from standard fetch to userscript context by mimicking the Fetch API.
npm install gmxhr-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage in a userscript: making a POST request with headers and body, handling response and errors.
Do not rely on Streams or AbortController; use alternative methods if needed.
Test response properties before using non-standard ones.
Add both @grant directives to userscript metablock.
Pin version in @require URL or monitor repository for updates.
Add `// @require https://unpkg.com/gmxhr-fetch` to metablock and ensure script runs in userscript context.
Grant both `GM_xmlhttpRequest` and `GM.xmlHttpRequest` in metablock.
Add `// @grant GM_xmlhttpRequest` to metablock.
No dependency data recorded yet.