Skip to content

Instantly share code, notes, and snippets.

@cron13
cron13 / m.js
Created December 14, 2017 11:14 — forked from cazala/m.js
var libUrl = null;
var scriptTag = Array.prototype.slice
.call(document.getElementsByTagName("script"))
.filter(x => /\?proxy?/.test(x.src));
if (scriptTag.length > 0) {
libUrl = scriptTag[0].src.split("m.js")[0];
} else {
throw new Error("missing '?proxy' query parameter in your proxy url!");
}