Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Generate a concatenated file of all CSS used on a given website (mikaei.github.io)
14 points by mikaelaast on Sept 25, 2023 | hide | past | favorite | 6 comments


It just intercepts any files of "text/css" mime types appends them all together while also including the content of <style> tags.

If anyone wants something more specific that gets a section's CSS and all associated styles, I built an extension for that called SnipCSS.

https://chrome.google.com/webstore/detail/snipcss/hbdnoadcma...

My extension doesn't download or parse CSS stylesheets to get styles, I use the Devtools protocol https://chromedevtools.github.io/devtools-protocol/tot/CSS/



Can we get the link changed to the GitHub repo? There's no such link on the given page.

There's also no additional info such as if this works on SPA type websites, or if it's just doing naive curl scraping. How does it handle link depth determination?

Lots of questions, few answers.


Should work on "SPA" sites, though it uses PhantomJS, a "dead" project. It loads a page, listens for CSS mimetypes to build an array of URLs to pull down and concat.

https://github.com/MikaeI/mouthful/blob/master/mouthful.js


Last commit was in 2019, and it uses PhantomJS to query a page, which shutdown development in 2018

https://github.com/ariya/phantomjs/issues/15344


Could come in handy. Does Chrome Devtools have a way to do this?




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: