OnetapInc / chromy

Chromy is a library for operating headless chrome. 🍺🍺🍺
MIT License
606 stars 41 forks source link

Ability to Inject Online Scripts #112

Open perumal opened 6 years ago

perumal commented 6 years ago

Hi All, Can anyone guide me on injecting an online script like www.domain.com/myscript.js instead of injecting an local offline script present in the drive like '/Users/john/dev/myscript.js'

chromy.chain()
    .goto('http://www.somedomain.com')
    .sleep(5000)
    .inject('js', 'http://www.domain.com/myscript.js')

If I inject an online script I am getting the following error

Error: ENOENT: no such file or directory, open 'http://www.domain.com/myscript.js'

Thank you