Skip to content

Instantly share code, notes, and snippets.

@PokeGuys
Last active March 19, 2022 10:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PokeGuys/6bd97693175f1579cb5701bc49cd43fe to your computer and use it in GitHub Desktop.
Save PokeGuys/6bd97693175f1579cb5701bc49cd43fe to your computer and use it in GitHub Desktop.
SPWN geo bypass
// ==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