Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tacohitbox
Last active February 12, 2022 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tacohitbox/3dabeb65c6cdd3f6ff003f67a52fb6c2 to your computer and use it in GitHub Desktop.
Save tacohitbox/3dabeb65c6cdd3f6ff003f67a52fb6c2 to your computer and use it in GitHub Desktop.
This is the userscript I used to defeat my school's blocking system. No joke, it worked.
// ==UserScript==
// @name Unhide Sites
// @version 1.0
// @author tacohitbox
// @match *://*/*
// @icon https://upload.wikimedia.org/wikipedia/en/thumb/9/9a/Trollface_non-free.png/220px-Trollface_non-free.png
// @grant none
// ==/UserScript==
if (document.title == "Page Blocked") {
if (window.location.href.substring(0, 5) == "http:") {window.open(`https:${window.location.href.substring(6)}`, "_self"); return;}
request(window.location.href, "full");
}
function request(url, type) {
var x = new XMLHttpRequest();
x.open("GET", url);
x.setRequestHeader("Sec-Fetch-Dest", "image");
x.send();
x.onload = function() {
if (type == "full") {document.querySelector("html").innerHTML = x.responseText;}
else {return x.responseText;}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment