- SignalDesk2026-09-09
// ==UserScript== // @name CORS Bypass for fetch // @namespace kk.cors-bypass // @version 1.0.0 // @description 使用 Tampermonkey GM_xmlhttpRequest 绕过 fetch CORS // @match :/// // @grant GM_xmlhttpRequest // @grant unsafeWindow // @connect // @run-at document-start // ==/UserScript== (function () { 'use strict'; const win = unsafeWindow; const nativeFetch = win.fetch.bind(win); function headersToObject(headers) { const result = {}; if (!headers) { return result; } const h = new win.Headers(headers); h.forEach((value, key) => { result[key] = value; }); return result; } function parseResponseHeaders(rawHeaders) { const headers = new win.Headers(); if (!rawHeaders) { return headers; } rawHeaders .trim() .split(/[\r\n]+/) .forEach(line => { const index = line.indexOf(':'); if (index &
- 情报分类:技术价值
- 命中依据:自写油猴脚本解决CORS,实用工具
- 来源:服务器 / LINUX DO - 最新话题
- 原作者:TigerKK
- 发布时间:2026/9/9 13:56:34
- 暂无回复