We created this as a free tool a while back on TestingBot: https://testingbot.com/free-online-tools/critical-css-genera....
It uses a remote browser to start a Puppeteer session and runs JavaScript code to extract the critical CSS needed for above-the-fold content. We chose Puppeteer because it’s fast to instrument the browser and works well even on JavaScript-heavy sites.
replies(1):