Reputation: 89
Most browsers have an option to save websites for offline use. The layout of the webpage usually is preserved just fine when one selects to save the complete webpage. Is there a way to invoke this functionality from js? or, failing that, what resources are saved by the browser when it saves a page and how is the HTML transformed?
Upvotes: 1
Views: 1751
Reputation: 4650
Nothing JS-related will be saved unless you explicitly design it to do so.
You can use localStorage
to save data on the user's browser. You have to carefully design a sync-ing algorithm to sync data to your database once the user goes online.
Look up Progressive Web Apps
How to save websites for offline use in JavaScript?
Now, saving pages from your browser desktop isn't a viable method of making a web-based product offline, certainly not in corporate environments. And the saved website will not always look exactly the same as you intend it to be. There's just no use to it besides re-reading information in scenarios where you won't have a connection, at least in my observation.
what resources are saved by the browser when it saves a page and how is the HTML transformed?
Images and css files, all jammed up in one folder
Upvotes: 2