We are currently working on a new version that will allow you to set a custom cache folder. The CacheFolderName is only the name part of the folder, it will still be generated in the temp directory.
I would like that component don't delete the cache folder at the end of the application and restart it using the cache from the previous session (if available).
Can you create a configuration to keep / use files from the previous cache?
Yes, We are changing the behavior. There will be an AutoClearCache and CacheFolder property. As well as a ClearCache method to manually clear the cache. The AutoClearCache can then be set to False to ensure the cache is not cleared when closing the form. The next version will address this. I have sent you an incremental source update that should allow doing this. (check your private messages)
The AutoClearCache:= False property was what I needed. THANK YOU !
I hope that the option to change the cache folder will be available soon.
Another question: is there an event that is triggered when changes occur on the displayed page? I need something like an OnPageChange or OnTextOnPageUpdade event that fires if any text or image on the page is changed.
This way you can have more than one instance with the same cache folder but different cache names.
There will be a cache folder for every instance of TTMSFNCWebBrowser.
For the question on the changes event, can you provide more in detail about what exactly you want to achieve? The OnNavigateComplete event is triggered for every navigation change. There is no detection mechanism for dynamic changes on the page.
I used the following code:
:
TMSFNCWebBrowser1.CacheFolder:='W:\Windows_Temp\Cache';
TMSFNCWebBrowser1.CacheFolderName:='Sessao_1';
TMSFNCWebBrowser1.AutoClearCache:=False;
TMSFNCWebBrowser1.Initialize;
:
In my application I display a page that processes a report (which can take several minutes).
When the report is finished, the page is updated informing that the report was sent to the informed email and I want to display an alert to the user.
It would be like, for example, using WhatsApp web and displaying a "popup" alert when receiving a new message.
About notifications, this is a browser specific feature. The embedded browser does not support the same kind of notifications through Windows as you get when running Facebook or Whatsapp. To notify the user the report is ready, you can install a JavaScript object bridge, then handle the notification in the client application that hosts the browser. I have attached a sample that demonstrates this.
We'll have to investigate how the caching works in WKWebView (the native webbrowser used in macOS). As far as I can see, macOS automatically applies caching and it doesn't share the cache with another instance.