Closed sissbruecker closed 2 months ago
Thank you, I applied the suggested changes but I did not change --headless
to --headless=new
because it breaks the support of frames (tested with https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe).
Thanks! Can confirm that overriding the --headless
option works now. That should be enough to get me started.
That iframe issue is a bit worrying, maybe I'll have to make using the extension optional. Let's see.
For the record, I've looked at what's wrong with using --headless=new
. In fact, this problem can also be reproduced by not launching Chrome in headless mode. For some reason that escapes me as I write this reply, window.postMessage()
does not work as expected, i.e. messages are not received by listeners in frames.
At worst, it should be possible to emulate it or rely on an alternative API that would only be used when single-file-core
is used by single-file-cli
though. This API would be proprietary and exposed by single-file-cli
(to single-file-core
).
For the record, the frame issue is fixed in the version v2.0.33
.
It does work now, thanks for following up on that. In general, using single-file with the new headless mode seems to work very well, haven't observed any other issues so far.
@sissbruecker Thank you for the feedback
One thing I'd like to be able to do is run single-file together with a Chrome extension like uBlock Origin, so that:
Traditionally running extensions in headless Chrome was not possible, however somewhat recently a new headless mode was introduced that allows you to do pretty much anything you can do with a headful (?) Chrome instance, such as running extensions: https://developer.chrome.com/docs/chromium/new-headless
Adding support for this would require two configuration options:
--headless=new
instead of--headless
--disable-extensions
browser arg that single-file applies by defaultI did try patching single-file-cli with these changes, and was able to get the extension loaded (requires an up-to-date Chromium as well). While I can deploy my app with a patched version of single-file, it would be great if this could be added to the core. I'm up for contributing these changes if we can align on an API / specific option naming.