{"slug": "clean-dom-exporter", "title": "Clean DOM Exporter", "summary": "A developer published a lightweight DevTools console snippet that clones the current document, strips bulky elements such as scripts, styles, SVGs, iframes and noscript tags, and copies the resulting minimal HTML to the clipboard. The tool is aimed at Chrome extension development, LLM prompt engineering, and DOM debugging without markup clutter.", "body_md": "A lightweight DevTools snippet to extract clean, minimal HTML structure from any live website.\n\nUseful for building Chrome extensions, prompt engineering with Large Language Models (LLMs), or debugging DOM structures without clutter like inline SVGs or scripts.\n\n1. Open DevTools in your browser (`F12` or`Ctrl + Shift + I` /`Cmd + Option + I` ).\n2. Go to the **Console** tab.\n3. Paste the following code and press **Enter** :\n\n``` js\n(() => {\n  // Clone current document structure\n  const clone = document.documentElement.cloneNode(true);\n\n  // Remove unnecessary bulky tags\n  clone.querySelectorAll('script, style, svg, iframe, noscript').forEach(el => el.remove());\n\n  // Copy cleaned HTML directly to clipboard\n  copy(clone.outerHTML);\n  console.log('Cleaned HTML copied to clipboard!');\n})();\n```\n\n1. The cleaned HTML is now in your clipboard!", "url": "https://wpnews.pro/news/clean-dom-exporter", "canonical_source": "https://gist.github.com/tobfd/87b142ee88bb0468b4a0cb3be3ec0138", "published_at": "2026-09-25 21:15:10+00:00", "updated_at": "2026-09-25 21:30:34.101373+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models"], "entities": [], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/clean-dom-exporter", "markdown": "https://wpnews.pro/news/clean-dom-exporter.md", "text": "https://wpnews.pro/news/clean-dom-exporter.txt", "jsonld": "https://wpnews.pro/news/clean-dom-exporter.jsonld"}}