Sure, busy times, lots of bugs, etc, but can we just get a simple button to copy/paste an entire chat page

Not so AI perhaps, but this copy/paste using the mouse is very tedious, so how about a nice download button somewhere on the page to capture an entire chat session as an unformatted text file. It would be a great gift. The “Export data” feature is a mess of html/json, and often fails to send an email.

Well, chatgpt gave me this js code to put into Chrome’s developer console:

function download(filename, text) {
  var element = document.createElement('a');
  element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
  element.setAttribute('download', filename); = 'none';


// Collecting text from the page
let allText = "";
document.querySelectorAll('*').forEach(element => {
    if (element.innerText && element.innerText.trim() !== '') {
        allText += element.innerText.trim() + "\n";

// Calling the download function
download("chat.txt", allText);

… maybe make that into a brower extension, so for now this will have to do.
Honestly, it does capture some extra text on the left side and the bottom, but that’s easier to cut/delete than doing a bunch of tedious copy/paste.