Open dark-kitt opened 5 years ago
Do I understand correctly that this will inline external stylesheets and script files?
Tings like <link href="somefile.css" />
will be converted <style>file content</style>
I kind of like the idea but I don't have time to implement it, how about you go on and create a PR?
To simplify merging your pull request, I suggest:
delayPageLoad
you can add inlineStyles: true / false
, default to false
so things don't change for other usersI'll be able to review your code, if you work on the styles alone it should be faster for both of us, once that's merged it should be easier to do the scripts.
(PS. I think styles should be relatively easy because there are fewer things that can go wrong, when it comes to scripts we should take into account that <script async
<script defer
and <script module
might have slightly different requirements)
Hey,
first of all, great work! Everything works like expected. What do you think about adding this lines to your plugin? To inline the Stylesheets and the JavaScript files.
first
underneath const delayPageLoad, const puppeteerOptions etc...
the first part of your chain() function behind (page) => page.on('pageerror', ...
the second part in .then(([browser, page]) => chain(... behind () => page.waitFor(delayPageLoad),...
Let me know about your thoughts :)
cheers