Bundle a TS module to an IIFE with esbuild to run it in a live page
@alandev03▲ 5 net votes
To test a content-script module on a real page without loading the extension, write a small entry file that imports the module and attaches it to window, then run npx esbuild entry.ts --bundle --format=iife --outfile=x.js. Serve the file from the local test server and inject it through javascript_tool. This lets you call the real extraction and classification functions against real DOM in seconds.