Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//META{"name":"maganedevhosted"}*//
const maganedevhosted = function() {};
maganedevhosted.prototype.vars = {
className: 'magane-script',
src: 'https://i.fiery.me/private/magane.min.js?_=1613150310',
unloadIds: [
'maganeContainer',
'localStorageIframe'
],
unloadStyles: [
'/** Magane: global.css **/',
'/** Magane: main.scss **/'
]
};
maganedevhosted.prototype.start = function() {
// Try to unload first.
maganedevhosted.prototype.stop();
const element = document.createElement('script');
element.className = maganedevhosted.prototype.vars.className;
element.setAttribute('src', maganedevhosted.prototype.vars.src);
document.head.appendChild(element);
};
maganedevhosted.prototype.stop = function() {
// Destroy script tags
document.querySelectorAll('head script.' + maganedevhosted.prototype.vars.className).forEach(e => {
e.parentNode.removeChild(e);
});
// Destroy APIs
if (typeof window.magane !== 'undefined') {
delete window.magane;
}
// Destroy elements
for (const id of maganedevhosted.prototype.vars.unloadIds) {
const element = document.getElementById(id);
if (element) {
element.parentNode.removeChild(element);
}
}
// Destroy styles
document.querySelectorAll('head style[type="text/css"]').forEach(e => {
const match = maganedevhosted.prototype.vars.unloadStyles.some(s => e.innerText.startsWith(s));
if (match) {
e.parentNode.removeChild(e);
}
});
};
maganedevhosted.prototype.getName = function() { return 'Magane-DEV-HOSTED'; };
maganedevhosted.prototype.getDescription = function() { return 'Bringing LINE stickers to Discord in a chaotic way.'; };
maganedevhosted.prototype.getVersion = function() { return '3.1.1-DEV-HOSTED'; };
maganedevhosted.prototype.getAuthor = function() { return 'Kana'; };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment