Live data from Hacker News

Show HN: CLI tool for saving web pages as a single file

github.com

151–160 of 216 posts

Re: Show HN: CLI tool for saving web pages as a single file

#151
post #129

Earlier quoted context omitted.

I used to use a VM (motivation being to run Linux on my locked-down corporate-imaged Macbook) and it was usable, but not as fast it could be if it had free reign over all CPU/RAM. But, at least the way I was doing it, it's not adding any security as discussed here, since you're doing everything in the VM so anything in the VM has access to everything just as if everything on the host anyway.

Scripts I run have access to my development environment for a free software project I already keep in a public repo. What they don't have access to is my actual desktop, nor yesterday's snapshot of the VM desktop. It's obviously not as fast as running GNU on bare metal, but it's fast enough for text work.

> it's fast enough for text work.

I guess this is where we set the bar in 2019.

Re: Show HN: CLI tool for saving web pages as a single file

#153

One thing I always wonder when I see native software posted here: How do you guys handle the security aspect of executing stuff like this on your machines? Skimming the repo it has about a thousand lines of code and a bunch of dependencies with hundreds of sub-dependencies. Do you read all that code and evaluate the reputation of all dependencies? Do you execute it in a sandboxed environment? Do you just hope for the…

These are the install instructions the docs say to use: $ git clone https://github.com/Y2Z/monolith.git $ cd monolith $ cargo install These are the ones I used: $ git clone https://github.com/Y2Z/monolith.git $ cd monolith $ sudo docker run --rm -w "$(pwd)" -v "$(pwd):$(pwd)" -u "$(id -u):$(id -g)" rust cargo install That isolated the build process. Similar method to isolate the execution of the built project: $ cd t…

Though I don't know the specifics, isn't it commonly advised to not rely on docker for secure isolation of potential malware?

Re: Show HN: CLI tool for saving web pages as a single file

#154

Earlier quoted context omitted.

I hear ya but another way to look at this is... The main problem with too many websites is they've become too much about technology and have left visitors, as well as the spirit and intent of the internet behind.

It stopped being about information and started being entertainment. I agree with you. BadSite: "we want you to experience this.." GoodSite: "we want you to learn this..."

To clarify myself a bit. Many of the new technologies are great...for building applications; applications where UI and UX are essential.

But for run-of-the-mill websites? Such tools are not only overkill, they break the spirit of the internet.

Re: Show HN: CLI tool for saving web pages as a single file

#155

The main problem with your code is that you only handle simple web1 site. What about javascript execution ? If you replay your capture, you have no idea of what you will see on general Web2 website. The only way I know to capture a web page properly is to "execute" it on a browser. Gildas, the guy behind SingleFile ( https://github.com/gildas-lormeau/SingleFile ) is well aware of that and his approach realy works eve…

The capture includes JS, so this should work for most JS-dependent sites, with the exception of scripts loading other additional assets. Tbh, often those are superfluous, or egregious examples of bad web dev, so it seems a reasonable solution for most cases. SingleFile is a different approach, but it's a lot more involved/less convenient than a cli, and loading in something like WebDriver on the cli for this would be…

So any ajax and it won't work?

Re: Show HN: CLI tool for saving web pages as a single file

#156
post #87

Earlier quoted context omitted.

I just clicked on the OP user name first which has the caption Bad boy . Then I read your comment. Now I worry more about the security aspect than before.

Its funny how we sometimes think about risk; if the caption was 'good egg' would you be more trusting?

People trust by default and only distrust when they spot a signal that believably correlates with maliciousness. Kind of like how people judge each other based on how they dress.

Re: Show HN: CLI tool for saving web pages as a single file

#157
If you only want a portion of a webpage I made a tool called SnipCSS for that:

https://www.snipcss.com

The desktop version saves an HTML file, stylesheet and images/fonts locally, and it only contains the HTML of the snippet with the CSS rules that apply to the DOM subtree of the element you select.

I'm still working out bugs but it would be great if people try it out and let me know how it goes.

Re: Show HN: CLI tool for saving web pages as a single file

#158

One thing I always wonder when I see native software posted here: How do you guys handle the security aspect of executing stuff like this on your machines? Skimming the repo it has about a thousand lines of code and a bunch of dependencies with hundreds of sub-dependencies. Do you read all that code and evaluate the reputation of all dependencies? Do you execute it in a sandboxed environment? Do you just hope for the…

This is a good question. I think you can make it even better by generalizing the problem. How on earth do developers hope to advance general computing forward when simply running programs isn't a solved problem? Most software engineers I know don't run docker on their home PCs. What about people who aren't in IT? Does anyone here even care? The general attitude I see is "plebs don't need to run anything they can't ge…

Even with decent containers, making software that's good enough for everyone to use is considerably more difficult than making it for yourself and a few friends.

It's okay to do things that don't scale at all, and also okay to make a proof of concept and let someone else worry about scaling it up.

That said, you might want to look at Chromebooks and the Windows and Mac app stores to see what's going on with containerization beyond mobile. (Also, web browsers.)

Re: Show HN: CLI tool for saving web pages as a single file

#159
post #11

I think it would be way better to explain in the repository: - how do you handle images? - does it handle embedded videos? - does it handle JS? to what extent? - does it handle lazily loaded assets (i.e. images that load only when you scroll down, or JS that loads 3 seconds later after the page is loaded) In general, how does this work? The current readme doesn't do a decent job explaining what the tool exactly is. F…

It can’t handle JS completely because we can’t predict a programs behaviour using static analysis. See Halting Problem for example.

Sure but many websites load resources and such with JS - the request might not contain the content but 3 seconds on the page with JS to let it fill in everything, etc.

SPA's often (but not always) do this. Content is loaded in via React components and such...

Re: Show HN: CLI tool for saving web pages as a single file

#160
post #153

Earlier quoted context omitted.

These are the install instructions the docs say to use: $ git clone https://github.com/Y2Z/monolith.git $ cd monolith $ cargo install These are the ones I used: $ git clone https://github.com/Y2Z/monolith.git $ cd monolith $ sudo docker run --rm -w "$(pwd)" -v "$(pwd):$(pwd)" -u "$(id -u):$(id -g)" rust cargo install That isolated the build process. Similar method to isolate the execution of the built project: $ cd t…

Though I don't know the specifics, isn't it commonly advised to not rely on docker for secure isolation of potential malware?

It's certainly not as secure as a VM, without a lot of safeguards.
Post reply on HN