Answer the question
In order to leave comments, you need to log in
How to save a static snippet of the DOM of an HTML page?
I need to save the page opened in the browser (Firefox/Chrome), but to do it not as browsers do, but so that the page looks exactly the same when the snapshot is opened as it was before saving.
Scripts, thus:
- should work until the moment of saving,
- should not be saved ,
- the result of their work should be saved.
According to HTTP, no one should break outside either.
Nugget Format: HTML/CSS/images.
Answer the question
In order to leave comments, you need to log in
ScrapBook based firefox extension? If ScrapBook itself doesn't fit.
I once wrote a similar extension (there were peculiar additional requirements for saving pages), referring to the ScrapBook code, it really takes several days to work there, if you just take the ScrapBook sources and file it, then you can meet the day.
write a kind of macro that will open the site with firebug, save the content of the html tab from it and load its dependencies (images, css, js). In theory, all functionality will be preserved + you have the state of the page at the right time. Implementation shouldn't be that hard either.
Option without extensions:
All page content with path replacement, perform the function on the desired page.
(function getCurrentSource() {
var doctype = document.body.parentNode.previousSibling,
content = '<!DOCTYPE' + (doctype.name ? ' ' + doctype.name : doctype.name) + (doctype.publicId ? ' ' + doctype.publicId : doctype.publicId) + '>\n' + document.body.parentNode.innerHTML,
base = window.location.href.replace(window.location.hash, '');
return content.replace(/<script\b[^>]*>(.*?)<\/script>/i, '')
.replace(new RegExp('((?:src|href)=[\"\']?)' + base, 'g'), '$1')
}());
wget -c -t0 -p -E -k www.google.com/
It looks like the www.peeep.us bookmarklet does what you want
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question