News for hackers. Stuff that matters.
Re:Jeff Atwood on growing Discourse by finchisko on Tuesday May 02, 2017 @02:28PM (#14249139)
>Similarly, you can only Ctrl-S to save the current page, not the whole thread.

This brought me to thinking why browsers still save page as source code and not as serialised actual DOM? I mean developers still could use curl to save source code, but regular users will save what they see on the screen, similarly to printing to PDF.

Re:Jeff Atwood on growing Discourse by thristian on Tuesday May 02, 2017 @05:33PM (#14250828)
What do you mean? Browsers do serialise the actual DOM.

I know this because I once saved a JS-heavy page and when I loaded it back into the browser, I discovered the JS-generated menus were already present in the source and were re-generated by the JS each time the page loaded.

Re:Jeff Atwood on growing Discourse by finchisko on Wednesday May 03, 2017 @03:17PM (#14259104)
>re-generated by the JS each time the page loaded.

yes, regenerated because js files are also stored. So the menu generating functions and all constants needed to generate menus were probably present in downloaded js files. But imagine, site that is also fetching data via ajax and render that data somehow. When you save and then reopen saved page, you might not get exact state as you were in time of saving. There are many reason why state would be different (you could be logged off, etc...) So if you send saved page to somebody, he/she will see different state of page than you. All of this could be eliminated if browsers saved state of DOM instead of page source code (and js,css resources).

Re:Jeff Atwood on growing Discourse by xfalcox on Tuesday May 02, 2017 @02:50PM (#14249369)
We made a feature, where we capture a CTRL+P and open a new window with the full topic and start the print, so it's easier to save a big topic to PDF and read it offline.