Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
docs: Update clipboard handling for Safari compatibility in LLMButtons component (#3421)
Richard Biroš1f31779685cc
diff --git a/website/src/components/LLMButtons.jsx b/website/src/components/LLMButtons.jsxindex 6f4f070fa..fead8a42f 100644--- a/website/src/components/LLMButtons.jsx+++ b/website/src/components/LLMButtons.jsx@@ -311,14 +311,23 @@ const onCopyAsMarkdownClick = async ({ setCopyingStatus, currentUrl }) => {try {setCopyingStatus('loading');- const response = await fetch(markdownUrl);+ // Safari requires clipboard writes to be created synchronously inside the user gesture.+ // We therefore pass a Promise that resolves to a Blob into ClipboardItem instead of+ // awaiting fetch first — otherwise Safari would reject the clipboard operation.+ const markdownContent = new ClipboardItem({+ 'text/plain': fetch(markdownUrl)+ .then((response) => {+ if (!response.ok) {+ throw new Error(`Failed to fetch markdown: ${response.status}`);+ }+ return response.text();+ })+ .then((content) => new Blob([content], { type: 'text/plain' })),+ });- if (!response.ok) {- throw new Error(`Failed to fetch markdown: ${response.status}`);- }+ await navigator.clipboard.write([markdownContent]);- const markdownContent = await response.text();- await navigator.clipboard.writeText(markdownContent);+ // Show success feedbacksetCopyingStatus('copied');} catch (error) {console.error('Failed to copy markdown content:', error);