4 ms·
Do you know if it is possible to render a page without serving it from a web server? For example, I have the html of one page of my domain generated by a test.
by testcross 9y ago
Do you know if it is possible to render a page without serving it from a web server? For example, I have the html of one page of my domain generated by a test. I would like to use puppeteer to render it. But I don't want to setup a http server for this. I would like to give a string with the html + a url to page.goto and let it render the page like it comes from the real server.
I guess I can cheat by intercepting the request and respond with the html I already have. But I wonder if there is already something existing.
- houli 9y agoYou should be able to use a data URI containing the HTML string
- egeozcan 9y agoIt's not allowed anymore: https://groups.google.com/a/chromium.org/forum/m/#!topic/blink-dev/GbVcuwg_QjM https://groups.google.com/a/chromium.org/forum/m/#!topic/bli...
- ConfucianNardin 9y agoThat's not correct. Initial assumption when reading the thread was that navigating to a data URI would be handled like entry of a data URI into the omnibox and still be allowed. A small test case confirms that assumption - it works.
- stokilo 9y agoSave response in a file and open in puppeteer using file protocol smth like file:///c:/response.html
- hugh7 9y agoThis is the point of chrome headless.