This is what I have so far:
function loadScript(url) {
return new Promise((resolve, reject) => {
let script = document.createElement('script');
script.onload = function() {
resolve();
};
script.src = url;
document.head.appendChild(script);
});
};
loadScript("https://rawgit2.com/icodeforlove/template-colors-web/master/dist-browser/template-colors.js").then(load);
function load() {
function logThing(pkt) {
pkt = pkt.join(', ');
console.log(c`${'['.red.bold}${pkt.green.bold}${']'.red.bold}`);
};
logThing(["Test", "thing", "here"]);
}
Normally, in dev tools console, it would log like this:
But with tampermonkey it logs this:
Why does tampermonkey do this? And how on earth do I fix this?