You need to call an API to screenshot the page, then figure out the JavaScript code to execute it. It’s not as easy as it might sound.
Playwright and selenium automate the browser itself, but with the chrome extension you need to use the context of the current browser.
I’m not an expert in browser automation so found it challenging moving from playwright to make it completely browser based.