Skip to content

Commit

Permalink
Update bookmarklet link
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 18, 2024
1 parent cda98e2 commit d1298d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h1>Install 'Chat Pager' -<br />the Bookmarklet to export a ChatGPT Chat</h1>
<main>
<p>This bookmarklet exports the whole current chat from ChatGPT (not only the last answer) including your prompts in html contents. When you run the bookmarklet, the html contents is stored in the clipboard. You then save it, send it, <a href="https://github.com/ulrischa/mail2github">archive</a> it or paste it where you want. It is a full styled html file - not only a snippet.</p>

<strong><a id="target" href="javascript:(()=&gt;{try{var e=document.querySelectorAll(&quot;article&quot;),t=(new Date).toLocaleString(),c=` &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;title&gt;Chat Export&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;https://unpkg.com/mvp.css&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css&quot;&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;&lt;a href=&quot;${window.location.href}&quot; target=&quot;_blank&quot;&gt;${window.location.href}&lt;/a&gt;&lt;/h1&gt; &lt;div class=&quot;timestamp&quot;&gt;Exported on: ${t}&lt;/div&gt; &lt;div class=&quot;chat-container&quot;&gt; `,a=(e.forEach(function(e,t){var a=e.querySelector(&quot;.whitespace-pre-wrap, .markdown&quot;),l=&quot;&quot;;a&amp;&amp;(e.querySelectorAll(&quot;img[width][height]&quot;).forEach(function(e){l+=e.outerHTML}),c+=` &lt;div class=&quot;chat-message ${t%2==0?&quot;right&quot;:&quot;left&quot;}&quot;&gt; &lt;div class=&quot;chat-bubble ${t%2==0?&quot;right&quot;:&quot;left&quot;}&quot;&gt; ${l}${a.innerHTML} &lt;/div&gt; &lt;/div&gt; `)}),c+=` &lt;/div&gt; &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js&quot;&gt;&lt;/script&gt; &lt;script&gt; hljs.highlightAll(); document.querySelectorAll(&quot;button.flex.gap-1.items-center.select-none.py-1&quot;).forEach(btn =&gt; { btn.addEventListener(&quot;click&quot;, function () { var pre = btn.closest(&quot;pre&quot;); if (pre) { var code = pre.querySelector(&quot;code&quot;); if (code) { var textarea = document.createElement(&quot;textarea&quot;); textarea.value = code.innerText; document.body.appendChild(textarea); textarea.select(); try { document.execCommand(&quot;copy&quot;); alert(&quot;Code copied to clipboard.&quot;); } catch (e) { alert(&quot;Failed to copy code.&quot;); } document.body.removeChild(textarea); } } }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; `,document.createElement(&quot;textarea&quot;)),l=(a.value=c,a.setAttribute(&quot;readonly&quot;,&quot;&quot;),a.style.position=&quot;absolute&quot;,a.style.left=&quot;-9999px&quot;,document.body.appendChild(a),a.select(),document.execCommand(&quot;copy&quot;));document.body.removeChild(a),l?alert(&quot;Complete HTML file with syntax highlighting and timestamp copied to clipboard.&quot;):alert(&quot;Failed to copy the content.&quot;)}catch(e){alert(&quot;Error: &quot;+e)}})();">Chat Pager</a></strong>
<strong><a id="target" href="javascript:(()=&gt;{try{var e=document.querySelectorAll(&quot;article&quot;),t=(new Date).toLocaleString(),a=` &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;title&gt;Chat Export&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;https://unpkg.com/mvp.css&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css&quot;&gt; &lt;style&gt; .w-fit { width: fit-content; max-width: 48rem; height: 100%; } .chat-container { width: 100%; max-width: 800px; margin: 20px auto; font-family: Arial, sans-serif; } h1 { text-align: center; margin-bottom: 10px; } .timestamp { text-align: center; margin-bottom: 20px; font-size: 14px; color: %23555; } .chat-message { display: flex; margin: 10px 0; } .chat-message.right { justify-content: flex-end; } .chat-message.left { justify-content: flex-start; } .chat-bubble { padding: 10px; border-radius: 10px; position: relative; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); overflow: hidden; } .chat-bubble.right { background-color: %23dcf8c6; } .chat-bubble.left { background-color: %23ffffff; } .chat-bubble.right::after { content: &quot;&quot;; position: absolute; right: -10px; top: 10px; border-width: 10px 0 10px 10px; border-style: solid; border-color: transparent transparent transparent %23dcf8c6; } .chat-bubble.left::after { content: &quot;&quot;; position: absolute; left: -10px; top: 10px; border-width: 10px 10px 10px 0; border-style: solid; border-color: transparent %23ffffff transparent transparent; } button.select-none { position: absolute; top: -5px; right: -5px; padding: 5px 10px; font-size: 12px; cursor: pointer; border: none; border-radius: 5px; } pre { position: relative; display: inline-block; } code { padding: 2px 4px; background-color: %23f5f5f5; border-radius: 3px; display: inline; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;&lt;a href=&quot;${window.location.href}&quot; target=&quot;_blank&quot;&gt;${window.location.href}&lt;/a&gt;&lt;/h1&gt; &lt;div class=&quot;timestamp&quot;&gt;Exported on: ${t}&lt;/div&gt; &lt;div class=&quot;chat-container&quot;&gt; `,r=(e.forEach(function(e,t){var r=e.querySelector(&quot;.whitespace-pre-wrap, .markdown&quot;),o=&quot;&quot;;r&amp;&amp;(e.querySelectorAll(&quot;img[width][height]&quot;).forEach(function(e){o+=e.outerHTML}),a+=` &lt;div class=&quot;chat-message ${t%2==0?&quot;right&quot;:&quot;left&quot;}&quot;&gt; &lt;div class=&quot;chat-bubble ${t%2==0?&quot;right&quot;:&quot;left&quot;}&quot;&gt; ${o}${r.innerHTML} &lt;/div&gt; &lt;/div&gt; `)}),a+=` &lt;/div&gt; &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js&quot;&gt;&lt;/script&gt; &lt;script&gt; hljs.highlightAll(); document.querySelectorAll(&quot;button.flex.gap-1.items-center.select-none.py-1&quot;).forEach(btn =&gt; { btn.addEventListener(&quot;click&quot;, function () { var pre = btn.closest(&quot;pre&quot;); if (pre) { var code = pre.querySelector(&quot;code&quot;); if (code) { var textarea = document.createElement(&quot;textarea&quot;); textarea.value = code.innerText; document.body.appendChild(textarea); textarea.select(); try { document.execCommand(&quot;copy&quot;); alert(&quot;Code copied to clipboard.&quot;); } catch (e) { alert(&quot;Failed to copy code.&quot;); } document.body.removeChild(textarea); } } }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; `,document.createElement(&quot;textarea&quot;)),o=(r.value=a,r.setAttribute(&quot;readonly&quot;,&quot;&quot;),r.style.position=&quot;absolute&quot;,r.style.left=&quot;-9999px&quot;,document.body.appendChild(r),r.select(),document.execCommand(&quot;copy&quot;));document.body.removeChild(r),o?alert(&quot;Complete HTML file with syntax highlighting and timestamp copied to clipboard.&quot;):alert(&quot;Failed to copy the content.&quot;)}catch(e){alert(&quot;Error: &quot;+e)}})();">Chat Pager</a></strong>

<br />
<br />
Expand Down

0 comments on commit d1298d4

Please sign in to comment.