carbonyl icon indicating copy to clipboard operation
carbonyl copied to clipboard

Script inject to web page ?

Open xnohat opened this issue 2 years ago • 1 comments

Hi, I try to using Carbonyl to replace PhantomJS as headless browser run in terminal. It's there anyway to access Carbonyl Chromium Developer Console from terminal or anyway to inject JS to webpage ?

Thanks in advance,

xnohat avatar Jan 31 '23 14:01 xnohat

Sure can! Carbonyl is based on Chrome headless, so you can use the --remote-debugging-port command line argument to enable the remote DevTools:

docker run -ti -p 9222:9222 fathyb/carbonyl https://youtube.com \
	--remote-debugging-port=9222 \
	--remote-debugging-address=0.0.0.0

On Chrome, go to chrome://inspect, you should see the webpage opened in Carbonyl, click Inspect to open the devtools.

fathyb avatar Jan 31 '23 15:01 fathyb