Skip to content

Instantly share code, notes, and snippets.

@xrip
xrip / blocker_extension.js
Created August 23, 2019 11:18 — forked from miry/README.md
Small blocker. curl https://gist.githubusercontent.com/miry/2a7635beaa7078e0d7af/raw/sync.sh | bash . Firefox addon: https://addons.mozilla.org/addon/browserblocker/ or /keybase/public/miry/browser_blocker-0.1-fx.xpi
function httpGet(theUrl, callback) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, true);
xmlHttp.onload = function (e) {
if (xmlHttp.readyState === 4) {
if (xmlHttp.status === 200) {
callback(JSON.parse(xmlHttp.responseText));
} else {
console.error(xmlHttp.statusText);
}