Open Gozala opened 3 years ago
I think there are several options to go about addressing this issue so I would like to list them here to gather some additional feedback.
contents.savePage
API, which according to the docs could save the page in mhtml format. It is not well supported file format, however it will probably do the job of saving page and then rendering it in the electron.
webContents.debugger
API provides access to the debugger protocol which seems to have Page.getResourceContent
method that can be used to get page resources without having to fetch it. Seems bit complicated but might be worth it. Maybe this could even be used to e.g. connect to running chrome browser and capture content from there, although not sure it is any better than current extension setup.
Me & @pvh have discussed this a bit on higher bandwidth channel, however since we were not able apply a simple fix I'm creating an issue here for further discussions.
We have identified problem to be caused by the fact that freeze-dry fails to
fetch
some resources e.g.https://github.githubassets.com/assets/frameworks-e9336e6b26b7848c1bbe761eacff9e7d.css%27
referenced fromhttps://github.com/automerge/automerge
duet CSP explicitly restricting that.Which is why when captured page is rendered it lacks styling. It is unclear however why
fetch
used in preload script follows same CSP restrictions as the page (I was expecting it to run in more privileged context like extension).