I'm trying to get an .html file with the html code of a Discord message and its styles (.css), so that when I open that .html in browser it looks the way it looks in Discord:
I tried using this code
var el = document.querySelector('#chat-messages-123456');
var els = el.getElementsByTagName("*");
for(var i = -1, l = els.length; ++i < l;){
els[i].setAttribute("style", window.getComputedStyle(els[i]).cssText);
}
but it doesn't work: the resulting div that I copy doesn't contain most of the styles.
I also tried looking at Computed CSS in element inspector, but it didn't even show background-color: property.