Comments (5)
With the above code, it does create a separate cache directory, but it should remember the username and password. Am I doing something wrong? Is there anything that needs to be corrected?
It should be noted that you need to comment out this line of code: // GlobalCEFApp.cache := 'cache';
from cef4delphi.
Copy the code that creates the child browsers in the MDIBrowser demo and it should work the same.
Assigning a new request context allows you to create independent browsers that store the cache, cookies, etc in a different directory for that browser.
Please, for more questions use our forum :
https://www.briskbard.com/forum/
from cef4delphi.
The code above is from MDIBrowser and has been tested many times without success. Have you tested this feature in FMX? Isn't the code above the same as in MDIBrowser? Could you please check this FMX demo?
from cef4delphi.
I reviewed the code repeatedly, and the final code is as follows:
procedure TBrowserFrame.CreateBrowser;
var
{$IFDEF MSWINDOWS}
TempHandle: HWND;
TempRect: System.Types.TRect;
TempClientRect: TRectF;
TempScale: single;
{$ENDIF}
begin
CreateFMXWindowParent;
if not (FMXChromium1.Initialized) then
begin
{$IFDEF MSWINDOWS}
TempHandle := FmxHandleToHWND(FMXWindowParent.Handle);
TempClientRect := FMXWindowParent.ClientRect;
TempScale := FMXChromium1.ScreenScale;
TempRect.Left := round(TempClientRect.Left);
TempRect.Top := round(TempClientRect.Top);
TempRect.Right := round(TempClientRect.Right * TempScale);
TempRect.Bottom := round(TempClientRect.Bottom * TempScale);
FMXChromium1.DefaultUrl := FHomepage;
var TempCache := GlobalCEFApp.RootCache + '\cache' + inttostr(1);
var TempContext := TCefRequestContextRef.New(TempCache, '', '', False, True, False, FMXChromium1.ReqContextHandler);
FMXChromium1.CreateBrowser(TempHandle, TempRect, '', TempContext);
// FMXChromium1.CreateBrowser(TempHandle, TempRect);
{$ENDIF}
end;
end;
This code still doesn't work. I believe there might be a bug in your FMX version. Could you please test it personally?
This is the modified code attachment.
from cef4delphi.
The issue with the non-persistent feature has been resolved. I used the following code:
var TempCache := 'D:\cache2';
var TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False, False, FMXChromium1.ReqContextHandler);
FMXChromium1.CreateBrowser(TempHandle, TempRect, '', TempContext);
The problem was that GlobalCEFApp.RootCache
was empty, so I needed to set an absolute path. However, a serious issue has now arisen: after setting the directory, the entire page becomes extremely sluggish—so much so that even entering a password is very slow, making it almost impossible to work. The video below demonstrates the entire process (the project works normally when the path is empty, with the rest of the code unchanged).
Attached is the recorded video file.
default.mp4
from cef4delphi.
Related Issues (20)
- Black screen browser in CEF 124 HOT 1
- ResponseFilterBrowser demo run error in delphi7? HOT 1
- ResponseFilterBrowser Demo run error in delphi7?
- TabbedBrowser2 leaves behind an orphan renderer process when main process is killed HOT 4
- Broken binary URL CEF 125.0.22 for Linux x86_64 HOT 2
- Multiple instances with the same binaries and incognito mode HOT 2
- Application crash navigating to web.dev with CEF 126 HOT 1
- CEF binaries missing! HOT 1
- CEF 126 proxy ERR_INVALID_AUTH_CREDENTIALS HOT 4
- Load a non-installed .pfx certificate HOT 1
- uMiniBrowser.pas(139,23) Error: Identifier not found "ICefMediaAccessCallback" HOT 2
- How CEF responds to JavaScript calls? HOT 2
- Using the source code of CEF 127.3.1 and the binary files in the folder, the FMX version crashes HOT 2
- In the FXM version, when using an independent cache, the page content loads extremely slowly. This has been tested multiple times HOT 1
- Demo ExternalPumpBrowser Helper (GPU) crash on MacOs 14 Sonoma - Lazarus x86_64-darwin HOT 10
- FMX,A transparent Form cannot display the browser; it appears blank. HOT 3
- The PopupBrowser demo for Lazarus in Windows crashes at shutdown with CEF 128 HOT 2
- Can you provide a Cef4Delphi that supports Windows 7, 8, 10, and above versions? HOT 2
- CEF 109 for windows7 crashes at closing application. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cef4delphi.