Added Cumcord loader plugin

This commit is contained in:
Alyxia Sother 2021-08-17 12:18:38 +02:00
parent c44edd8009
commit 95c68f2eb1
No known key found for this signature in database
GPG Key ID: 355968D14144B739
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,11 @@
{
"main": "index.js",
"name": "CumcordLoader",
"description": "Loads Cumcord.",
"tags": ["mod"],
"authors": ["465702500146610176"],
"version": "1.0.0"
}

21
cumcord-loader/index.js Normal file
View File

@ -0,0 +1,21 @@
import showToast from "@goosemod/toast";
function reqListener() {
eval(this.responseText);
showToast("Cumcord has injected.");
}
export default {
goosemodHandlers: {
onImport: () => {
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", reqListener);
oReq.open("GET", "https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js");
oReq.send();
},
onRemove: () => {
window.cumcord.uninject();
showToast("Cumcord has been uninjected.");
}
}
};