▲ | dataviz1000 5 days ago | |||||||||||||||||||||||||
I'm copying the Puppeteer / Playwright client API to run in a Chrome extension using the native Chrome extension APIs. It is possible to run Playwright inside a Chrome extension, however, it requires the Chrome DevTools Protocol (CDP) to automate a browser which really hurts the user experience, is very slow, and opens security vulnerabilities. Chrome extension APIs can accomplish maybe ~85% of the same functionality as CDP or Webdriver BiDi -- it isn't complete because of security features which shouldn't be bypassed anyhow. For example, instead of calling a function in a content script with 'script.callFunction' with Webdriver BiDi in Playwright, a function is called with chrome.scripting.executeScript(). It will be 2 or 3 more weeks before I post a PoC. This is following my work using VSCode's core libraries in a Chrome extension exactly as they are used in an Electron app to drive VSCode and Cursor. The important part is VSCode's IPC / RPC which allows all the execution contexts and remote runtimes to communicate with each other. [0] This solves many problems I have had in the past automating browsers with a Chrome extension. | ||||||||||||||||||||||||||
▲ | tech234a 5 days ago | parent [-] | |||||||||||||||||||||||||
Cool concept, would you expect this to be compatible with Firefox/Safari as well? Safari in particular would be useful as it doesn't natively support Puppeteer/Playwright. | ||||||||||||||||||||||||||
|