Last active
March 19, 2022 10:13
-
-
Save PokeGuys/6bd97693175f1579cb5701bc49cd43fe to your computer and use it in GitHub Desktop.
SPWN geo bypass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name SPWN geo bypass | |
// @namespace spwn.geo.bypass | |
// @version 0.3 | |
// @description Bypass SPWN geocheck. | |
// @author PokeGuys | |
// @match *://spwn.jp/* | |
// @match *://virtual.spwn.jp/* | |
// @run-at document-start | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Hook `fetch` function to inject our patched code. | |
const originalFetch = window.fetch; | |
window.fetch = async function() { | |
return Promise.resolve(originalFetch.apply(window, arguments)).then(res => { | |
// Apply response patch to `/check_geo` endpoint | |
const url = new URL(res.url); | |
if (url.pathname.includes('/check_geo')) { | |
// Apply patch and restore hook | |
window.fetch = originalFetch; | |
return new Response('{"isError": false}'); | |
} | |
return res; | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment