您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Intercepts and changes the geo request (they clearly wanted this to be possible) allowing for spoofing of country.
// ==UserScript== // @name radio.garden: bypass region restrictions (e.g. UK) // @namespace assuka.radio.garden // @match https://*.radio.garden/* // @grant none // @version 1.0 // @author Assuka // @license MIT // @description Intercepts and changes the geo request (they clearly wanted this to be possible) allowing for spoofing of country. // @run-at document-idle // ==/UserScript== window.fetch = new Proxy(window.fetch, { apply: (target, that, args) => { const originalFetchPromise = target.apply(that, args); const modifiedPromise = originalFetchPromise.then(async (res) => { if (/api\/geo/.test(res.url)) { const clonedRes = res.clone(); const data = await clonedRes.json(); data.country_code = 'US'; data.region_code = 'CA'; // California data.city = 'Los Angeles'; const headers = new Headers(res.headers); headers.delete('Content-Length'); return new Response(JSON.stringify(data), { status: res.status, statusText: res.statusText, headers: headers }); } return res; }); return modifiedPromise; } });