▲ 3 r/Alibaba
Here is how to export chat history with ease
I got inspired by this guy who shared his knowledge.
This is an updated version that formats the chat a bit nicer.
here is the instruction
- Make a bookmark with the code below instead of URL
​
javascript:(function(){var chatNode=document.querySelector('.message-flow-container');if(!chatNode){alert('Chat not found. Please make sure the chat history is loaded.');return;}var clone=chatNode.cloneNode(true);clone.querySelectorAll('.read-status,.message-flow-menu-box, .session-translate').forEach(function(el){el.remove();});var items=Array.from(clone.querySelectorAll('.item-content'));if(items.length>1){var parent=items[0].parentNode;items.reverse().forEach(function(el){parent.appendChild(el);});}var iframe=document.createElement('iframe');iframe.style.position='fixed';iframe.style.right='0';iframe.style.bottom='0';iframe.style.width='1px';iframe.style.height='1px';iframe.style.border='0';iframe.style.opacity='0';document.body.appendChild(iframe);var doc=iframe.contentWindow.document;var css='<style>body{background:#fff!important;height:auto!important;overflow:visible!important;margin:0!important;padding:20px!important;font-family:Arial,sans-serif!important}.message-flow-container{width:100%!important;height:auto!important;overflow:visible!important;position:static!important;display:block!important}.item-content{box-sizing:border-box!important;max-width:72%!important;width:fit-content!important;min-width:220px!important;margin:10px 0!important;padding:10px 14px!important;border:1px solid #ccc!important;border-radius:12px!important;background:#fff!important;page-break-inside:avoid!important;break-inside:avoid!important}.item-content-left{margin-right:auto!important;margin-left:0!important;text-align:left!important}.item-content-right{margin-left:auto!important;margin-right:0!important;text-align:left!important}.item-base-info{font-size:10px!important;color:#555!important;margin:0 0 6px 0!important}.user-content{font-size:13px!important;line-height:1.45!important}.quote-container{font-size:11px!important;line-height:1.35!important;color:#555!important;background:#f7f7f7!important;border:1px solid #d8d8d8!important;border-radius:8px!important;padding:6px 8px!important;margin:6px 0 8px 0!important;max-width:100%!important;box-sizing:border-box!important}.quote-wrapper *{font-size:inherit!important;line-height:inherit!important}.read-status,.message-flow-menu-box{display:none!important}*{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}img{max-width:100%!important;height:auto!important;display:block!important}button,input,textarea,select{display:none!important}</style>';var html='<!DOCTYPE html><html><head><meta charset="UTF-8">'+css+'</head><body>'+clone.outerHTML+'</body></html>';doc.open();doc.write(html);doc.close();setTimeout(function(){iframe.contentWindow.focus();iframe.contentWindow.print();setTimeout(function(){document.body.removeChild(iframe);},3000);},1000);})();
- Go to the message page and scroll to the point where you want to start download the chat
- Click the bookmark button (on the same page)
- It should bring up print page for the chat. Change the printer to "save as PDF"
- Use that to file Trade Assurance claim for the one who messed up with you.
Troubleshoot:
if nothing happens after you click on the bookmark, it might be because of your popup block. Go to site setting to allow popups for the messages page.
u/Coaruv — 7 days ago