
And you would have a block of JavaScript that would execute on page load to restore all the JavaScript functions, variables, event handlers etc. Meaning that you would have a big style block at the beginning of the page defining all the styles that are relevant for the document (with all the relative URLs corrected of course). Solution: when saving remove all CSS and JavaScript that was in the web page originally and replace it by a correct representation of the current web page state. You can get even more images by saving again.
#Southpark anti adlock code#
If you save this page and open it again, what will you see? Right, two images - one that already was on the web page when it was saved and a second that was created by this code when the saved page was opened. Because the web page might have code like this: So CSS might still contain relative URLs and JavaScript… well, ideally you would save JavaScript’s current state as well. While the HTML code is serialized from the DOM tree and is a perfect copy of what is currently displayed in the browser, JavaScript and CSS are not taken care of. The saved image of the web page isn’t perfect. That last one is a showstopper so that supporting Microsoft’s MTHML format is probably still the more realistic alternative even though it means much more effort. Most importantly however, if the same image is used multiple times on the page it will have to be stored multiple times, no way to specify “this image uses the same URL as image XYZ” in HTML. However, I noticed disadvantages as well: this file wouldn’t be usable in Internet Explorer (it still doesn’t support data: URLs).

This would have the advantage of sticking to the HTML format, also nothing other than the web page saving code would need to be changed. I first thought of using the data: urls to embed all data inside the same HTML file.
#Southpark anti adlock windows#
Yes, if you happen to use Windows Explorer it will remove this directory automatically but this is a hack and a very non-obvious action again.

Even if he knows it, it still means some effort locating the directory which is annoying. It isn’t obvious to the user that this will happen and that he has to remove the directory as well when he chooses to remove the saved page. It doesn’t just create the file the user told it to create but also a directory for the auxiliary files. So I tried to understand why this user was so upset and why I almost never use this feature myself. Generally this doesn’t seem to be such a bad idea, it allows you to open a saved web page and it will look exactly the same. His problem was easily solved with a configuration change but it got me thinking. I read a forum question from an Opera user who was upset because Opera 9.10 now saves web pages “like IE and Firefox” – meaning saving them with all the included files.
