3 ms·
>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
by finchisko 9y ago
>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.
- xfalcox 9y agoWe 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.
- thristian 9y agoWhat 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.
- finchisko 9y ago>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).