ClericPy / ichrome

Chrome controller for Humans, based on Chrome Devtools Protocol(CDP) and python3.7+.
https://pypi.org/project/ichrome/
MIT License
228 stars 29 forks source link

How could I use Runtime.compileScript in ichrome? #46

Closed Champollion9012 closed 3 years ago

Champollion9012 commented 3 years ago

I want to use this method(Runtime.compileScript) from Chrome DevTools Protocol in ichrome. How could I use Runtime.compileScript in ichrome? I just know the tab.js(). Could you give me an example?

btw, Debugger.setBreakpoint this method, I also need.

ClericPy commented 3 years ago

Those are not default methods for it is not very common usage.

You can do like this: data = await tab.send('Runtime.compileScript', expression='xxx', sourceURL='xxx')

Champollion9012 commented 3 years ago

Thx

ClericPy commented 3 years ago

you're welcome