{"id":15254640,"url":"https://github.com/trim21/gm-fetch","last_synced_at":"2025-07-26T08:38:17.036Z","repository":{"id":37901034,"uuid":"498522484","full_name":"trim21/gm-fetch","owner":"trim21","description":"fetch API for `GM.xmlHttpRequest`","archived":false,"fork":false,"pushed_at":"2025-07-13T19:10:12.000Z","size":10334,"stargazers_count":30,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-13T21:21:44.870Z","etag":null,"topics":["fetch","javascript","userscript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trim21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-31T23:00:29.000Z","updated_at":"2025-07-13T19:09:53.000Z","dependencies_parsed_at":"2023-02-10T21:45:20.660Z","dependency_job_id":"41ac5176-58ee-457a-ac9d-f7bd4842d65d","html_url":"https://github.com/trim21/gm-fetch","commit_stats":{"total_commits":105,"total_committers":4,"mean_commits":26.25,"dds":0.4,"last_synced_commit":"604ac411905c8d4a4ba7bfe3412db7bd3b33be62"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/trim21/gm-fetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trim21%2Fgm-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trim21%2Fgm-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trim21%2Fgm-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trim21%2Fgm-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trim21","download_url":"https://codeload.github.com/trim21/gm-fetch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trim21%2Fgm-fetch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267141117,"owners_count":24041982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fetch","javascript","userscript"],"created_at":"2024-09-29T23:05:21.718Z","updated_at":"2025-07-26T08:38:17.024Z","avatar_url":"https://github.com/trim21.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fetch for UserScript\n\nusing fetch based on `GM.xmlHttpRequest` in userscript.\n\n**Don't forget to add `@grant GM.xmlHttpRequest` and `@connect` in your metadata**\n\n## Introduction\n\nIt's not 100% same with fetch API because some security limit like cors site request doesn't exist on `GM.xmlHttpRequest`.\n\nAnd `AbortSignal` is not supported very well due to the limitation of `GM.xmlHttpRequest`.\n\nYou can set some HTTP headers allowed by `GM.xmlHttpRequest` but not allowed by standard fetch API.\n\n## Example\n\nadd this script to UserScript manager and visit \u003chttps://example.com/\u003e\n\n```javascript\n// ==UserScript==\n// @name        new user script\n// @version     0.0.1\n// @match       https://example.com/*\n// @grant       GM.xmlHttpRequest\n// @require     https://cdn.jsdelivr.net/npm/@trim21/gm-fetch\n// @run-at      document-end\n// @connect     httpbin.org\n// ==/UserScript==\n\n(async () =\u003e {\n  const res = await GM_fetch(\"https://httpbin.org/headers\", { method: \"GET\" });\n  const data = await res.json();\n  console.log(data);\n})();\n```\n\n(you can't use `@require https://cdn.jsdelivr.net/npm/@trim21/gm-fetch` directly if you want to upload your script to GreasyFork,\nyou will need to specify version you want to use, for example `@require https://cdn.jsdelivr.net/npm/@trim21/gm-fetch@0.1.15`)\n\n## if you are using js bundler\n\nES Module:\n\n```javascript\nimport GM_fetch from \"@trim21/gm-fetch\";\n```\n\n## Browser Compatibility\n\nThis package is using `Request` and `Response` class, it so requires a browser with fetch API support.\n\n\u003chttps://caniuse.com/?search=Blob.stream\u003e\n\n## Licence\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrim21%2Fgm-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrim21%2Fgm-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrim21%2Fgm-fetch/lists"}