8000 GitHub - rubycoder/claude: Bookmarklets to process the content on Claude.ai with a single click (export to PDF, print long conversations, etc.)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bookmarklets to process the content on Claude.ai with a single click (export to PDF, print long conversations, etc.)

Notifications You must be signed in to change notification settings

rubycoder/claude

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

8000

Claude.ai Bookmarklets

These bookmarklets allow you to process the content on Claude.ai with a single click:

Bookmarklet Under the hood
Export the content to PDF This bookmarklet loads the html2pdf library from the Cloudflare CDN to work locally in order to avoid sending any data to any server. The library is used to convert the content of the dialog and artifacts to a PDF file (A4 format, portrait orientation, 5mm margins, and 2x scale). The filename is generated based on the current date and time.
Print the content directly or save as PDF This bookmarklet creates a temporary print-specific stylesheet and a temporary container, clones the content of the dialog and artifacts into this container. When printing, only this container is displayed while all other page elements are hidden. The native browser print function is used, allowing to print directly or save as PDF. After printing, the temporary stylesheet and container are automatically removed.

It's completely secure with no installations, data sharing to third parties, or extensions needed. Everything runs entirely in your browser.

When user interface of Claude.ai changes, these tools may need to be updated because the content of dialogs and artifacts are found using the following CSS selectors:

  • parent of div[data-test-render-count] (dialog),
  • div.fixed div.overflow-y-scroll (artifacts).

Bookmarklet to export the content to PDF

  1. Add a new bookmark to your browser with any name (e.g. "Claude to PDF") and the following code as URL:

    javascript:(function(){/* v. 0.4, github.com/give-me/claude */let s=document.createElement('script');s.src='https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.2/html2pdf.bundle.min.js';s.onload=function(){let t=new Date().toISOString().replace(/[-:T.]/g,'').slice(0,14),e1=document.querySelector('div[data-test-render-count]').parentElement,e2=document.querySelector('div.fixed div.overflow-y-scroll');let pdf=html2pdf().set({margin:5,filename:`${t}.pdf`,html2canvas:{scale:2,logging:false}}).from(e1);e2&&(pdf=pdf.toPdf().get('pdf').then(pdfObj=>pdfObj.addPage()).from(e2).toContainer().toCanvas().toPdf());pdf.save();};document.body.appendChild(s);})();
  2. Open any dialog on Claude.ai.

  3. Click on the bookmark.

  4. Wait for the PDF.

Unminified code is available here.

Bookmarklet to print directly or save as PDF

  1. Add a new bookmark to your browser with any name (e.g. "Claude to printer") and the following code as URL:

    javascript:(function(){/* v. 0.4, github.com/give-me/claude */let style=document.createElement('style');style.textContent='@media print{body>*{display:none!important}#temp{display:flex!important;flex-direction:column}}';document.head.appendChild(style);let temp=document.createElement('div'),e1=document.querySelector('div[data-test-render-count]').parentElement,e2=document.querySelector('div.fixed div.overflow-y-scroll');temp.id='temp';temp.appendChild(e1.cloneNode(true));e2&&temp.appendChild(e2.cloneNode(true));document.body.appendChild(temp);print();setTimeout(()=>{document.head.removeChild(style);document.body.removeChild(temp);},1000);})();
  2. Open any dialog on Claude.ai.

  3. Click on the bookmark.

  4. Wait to print directly or save as PDF.

Unminified code is available here.

About

Bookmarklets to process the content on Claude.ai with a single click (export to PDF, print long conversations, etc.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%
0