OnetapInc / chromy

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

opening HTML as data-uri #43

Closed pkra closed 6 years ago

pkra commented 6 years ago

First off, thanks for chromy!

Is there a way to open HTML given as a data-URL?

For example, the following doesn't return anything:

chromy
    .chain()
    .goto('data:text/html,<h1>Hello%2C%20World!<%2Fh1>')
    .evaluate(() => {
        return document.body.innerHTML;

    })
    .result((r) => console.log(r))

This is not hard to work around (e.g., passing a string along and setting body.innerHTML) but it would be convenient to just open the data straight away.

dotneet commented 6 years ago

Hi @pkra,

Thank you for opening the issue. It's just a bug. I'll fix it in the next release.

pkra commented 6 years ago

Ah, that's great to hear - thanks, @dotneet!

pkra commented 6 years ago

Thanks!