Hello,
common browser have the possibility to save the loaded page as HTML with all the images and resource files. The HTML is then also changed to load the resourcefiles from disk.
Is there a build in function in CEF4Delphi, to do this without reloading the resources?
Thanks, also for your great work.
Benno
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Page Save as
- salvadordf
- Posts: 4575
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Page Save as
Hi,
I'm afraid that feature is not included in CEF.
You can save the raw HTML file and each image (with some extra code in your app) but as far as I know CEF doesn't modify the internal resource links tbefore you save them in a local drive.
You also have the possibility to save the print the web page as a PDF file or take a screenshot of the web contents.
I'm afraid that feature is not included in CEF.
You can save the raw HTML file and each image (with some extra code in your app) but as far as I know CEF doesn't modify the internal resource links tbefore you save them in a local drive.
You also have the possibility to save the print the web page as a PDF file or take a screenshot of the web contents.
Re: Page Save as
Hi,
I‘ve already created such a function. But sometimes, it downloads an image or another resource again, although it has already been displayed.
Is it possible to extract resources from the browser cache and to avoid a further download?
Regards
Benno
I‘ve already created such a function. But sometimes, it downloads an image or another resource again, although it has already been displayed.
Is it possible to extract resources from the browser cache and to avoid a further download?
Regards
Benno
- salvadordf
- Posts: 4575
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Page Save as
I'm not aware of any function to read cache contents directly but you can use a simple TStringList protected by a critical section in the TChromium.OnBeforeResourceLoad event to keep a list of resources. Set the TStringList.Duplicates property to false in order to avoid repeated resources and call TChromium.DownloadImage for each item when the web page is fully loaded.
There are some interesting DevTools methods that you can use too :
https://chromedevtools.github.io/devtoo ... /tot/Page/
I have used only a fraction of those methods but it seems possible to do all kinds of DOM modifications, get resource contents, etc...
There are some interesting DevTools methods that you can use too :
https://chromedevtools.github.io/devtoo ... /tot/Page/
I have used only a fraction of those methods but it seems possible to do all kinds of DOM modifications, get resource contents, etc...