Uložit konverzaci jako soubor .txt
Verze ze dne
Automatically add a fixed position“Save the conversation”Button,After clicking the button, the chat conversation content in the current page will be extracted and saved as a plain text file.,Convenient to users export and backup chat history。
Extract chat messages
From all included in the page data-message-id Elements of attributes extract conversation content,And according to data-message-author-role Attribute judgment role(User / Assistant wait)。
Format text
according to Character name: Line break,Write the corresponding text content,每条消息之间用Separation符 --- 分隔。
Generate file name
Priority to the use of web titles40characters as file name,If there is no title, start with the dialogue5Lowercase splicing of words as file names,The default file name is conversation.txt。
Download text file
use Blob Object creation download link,Simulate click to download the conversation content text file。
Interface interaction
A small button is displayed in the upper left corner of the page,Click to save the current conversation。
capitalizeRole(role):Format the initial letter of the role based on the role string。generateFileName(messages):Generate file name based on page title or first message。saveConversation():Core Functions,Collect message content、format、Generate file and trigger download。createDownloadButton():Create and add a fixed one“Save the conversation”Button to page。waitForBody Timer:Wait for the page body and chat messages to complete the loading of buttons。data-message-id and data-message-author-role The structure of attributes)。.txt document。data-message-id and data-message-author-role property。.whitespace-pre-wrap or .markdown Text content of class。This script is suitable for users who need to quickly save web chat history。
🧑💻 @Taylor-eOS ⇒ 📜 Save Conversation

Recommended browser and script manager:
If you need to learn more about how to install user scripts,Click meView the teaching of pictures and texts!

