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.
Tell me is it possible to encapsulate the Chromium component?
-
- Posts: 6
- Joined: Wed Aug 18, 2021 10:44 pm
Tell me is it possible to encapsulate the Chromium component?
Hello. Tell me is it possible to encapsulate the Chromium component? The problem is that there are sites with memory leaks, if the exe page is open for a long time, it closes due to overflow. I wanted to monitor the growth of memory and if it reaches the specified limit, the page will be reloaded.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Tell me is it possible to encapsulate the Chromium component?
Hi,
Yes, it's possible to encapsulate the browser in your application.
BriskBard uses CEF4Delphi and WebView4Delphi to embed Chromium-based web browsers :
https://github.com/salvadordf/CEF4Delphi
https://github.com/salvadordf/WebView4Delphi
Please, let me know the URL of those pages with leaks to fix this issue.
Yes, it's possible to encapsulate the browser in your application.
BriskBard uses CEF4Delphi and WebView4Delphi to embed Chromium-based web browsers :
https://github.com/salvadordf/CEF4Delphi
https://github.com/salvadordf/WebView4Delphi
Please, let me know the URL of those pages with leaks to fix this issue.
-
- Posts: 6
- Joined: Wed Aug 18, 2021 10:44 pm
Re: Tell me is it possible to encapsulate the Chromium component?
Any js code can cause a memory leak, for example
, setInterval(() => {window.i=window.i+'432434243432443243';}, 1);
, setInterval(() => {window.i=window.i+'432434243432443243';}, 1);
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Tell me is it possible to encapsulate the Chromium component?
That kind of errors should be debugged and fixed by the developers of that web page using the developer tools (DevTools) available in the browser.
-
- Posts: 6
- Joined: Wed Aug 18, 2021 10:44 pm
Re: Tell me is it possible to encapsulate the Chromium component?
I agree with you 100%, but the developers of their resources are people not controlled by the browser. And in Delphi, I place a component that should be able to deal with this, at least to understand that memory has reached a critical threshold and it is necessary to forcibly update the page. Is there a function that will return the size of the occupied memory of the browser page?
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Tell me is it possible to encapsulate the Chromium component?
I'll have to investigate if Chromium exposes any setting or command line switch that helps in come of these cases.