gildas-lormeau / single-file-cli

CLI tool for saving a faithful copy of a complete web page in a single HTML file (based on SingleFile)
GNU Affero General Public License v3.0
539 stars 57 forks source link

headless=false not work #68

Closed awayme closed 3 months ago

awayme commented 3 months ago

OS: Ubuntu 22.04 Singlefile version: v2.0.9 / v2.0.6 Browser Chromium 122.0.6261.128 / Google Chrome 123.0.6312.58

In these two versions, it's still running in headless mode even when headless=false is specified. By checking ps aux | grep chromium , it can be found that there are two duplicated --headless --headless in the startup parameters of the browser. v2.0.3 is normal, and I haven't tested v2.0.5


Besides, I would like to ask, if I want to use the --browser-arg parameter to specify the user data directory, how should the specific parameters be written? For example, is it necessary to escape double quotes, or add square brackets. According to your replies in several other posts, I tried and they were all wrong.

gildas-lormeau commented 3 months ago

The syntax of the switch is --browser-headless=false. There was however a bug related to the handling of default values. The last version (2.0.10) fixes this.


You should use " if the path contains a space character. The example below should work:

./single-file https://www.example.com --browser-arg="--user-data-dir=/a path/to a/folder" --browser-headless=false

or

./single-file https://www.example.com --browser-arg --user-data-dir="/a path/to a/folder" --browser-headless=false
awayme commented 3 months ago

I apologize, my use of shorthand in writing (headless=true) indeed led to ineffective communication and wasted time. I've tested the last version (2.0.10), and the issue with headless has indeed been fixed. Thanks

gildas-lormeau commented 3 months ago

No problem, thank you for the feedback.