Jump to content

salvadordf

Members
  • Content Count

    39
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by salvadordf


  1. WebView4Delphi uses the WebView2 framework to embed an Edge browser. 

     

    Edge is based on Chromium but the WebView2 framework is updated automatically by Windows.

     

    I just updated the readme in the repository to avoid confusions.

     

    I suggested WebView4Delphi because it gives you a lot more details in case of initialization problems. It's updated to the latest WebView2 framework version and it implements all the interfaces exposed by WebView2.


  2. Try using WebView4Delphi and implement the TWVBrowser.OnInitializationError and GlobalWebView2Loader.OnInitializationError events.

    Check the GlobalWebView2Loader.ErrorMessage and GlobalWebView2Loader.ErrorCode values too.

     

    Keep the browser visible until it's fully initialized and then hide it.


  3. Some Windows users received a faulty Windows update with WebView2 Runtime 131 that broke the official way to check if the evergreen runtime is installed in the computer.

    Microsoft stopped the deployment of that update and then released a fix but some computers may still have the broken runtime.

     

    In the case of WebView4Delphi this update caused the GlobalWebView2Loader.StartWebView2 call to return false because it couldn't find the WebView2 runtime on the system.

    As a temporary workaround, set GlobalWebView2Loader.CheckFiles to FALSE before the GlobalWebView2Loader.StartWebView2 call.

     

    Read this issue in the feedback repository for more details.

    • Thanks 2

  4. The BPL files should be created in $(BDSCOMMONDIR)\Bpl and not in the WebView4Delphi\packages directory.

     

    Perhaps the "Package output directory" option is not set to $(BDSCOMMONDIR)\Bpl

     

    Open the Tools -> Options... menu option and then select the "Environment options -> Delphi options -> Library" node in the left tree view.

    There you can check the "Package output directory" value.

     

    If you can't modify that setting try adding the WebView4Delphi\packages directory to the search path.


  5. I just made public the WebUI4Delphi open source project at GitHub.

    WebUI4Delphi is a WebUI wrapper, which allows you to use any web browser as a GUI, with Delphi in the backend and HTML5 in the frontend.

    WebUI doesn't embed a web browser. It just connects your Delphi application with the installed web browser using a fast protocol so you can use HTML5 as part of the GUI.

    WebUI4Delphi can be used in 64 bit Delphi applications for Windows. Linux and MacOS support needs testing.

    There are several VCL, FireMonkey and console demos.

    https://github.com/salvadordf/WebUI4Delphi

    • Like 4
    • Thanks 1

  6. 4 hours ago, ChrisChuah said:

    Hi

    Has anyone tried out this CEF4Delphi

     

    https://github.com/salvadordf/CEF4Delphi

     

    It seems it can embed chromium based browser into Delphi App and support for Linux

     

    Please advise

     

    regards

    chris

     

    Yes. CEF4Delphi works on Windows, Linux and macOS.

     

    There are some unresolved issues in Linux but it works :

    https://github.com/salvadordf/CEF4Delphi/issues?q=is%3Aissue+is%3Aopen+label%3ALinux


  7. Some suggestions :

    • Use a custom captcha when registering new users. Some forum plugins allow you to create custom questions or things like that. Don't use any version of Google recaptcha. All of them were cracked ages ago.
    • Some forums allow you to moderate the first messages of new users. This gives you some extra work but it blocks all spammers that registered manually.
    • Some forums have plugins that block new users that try to use known spammers IPs, email addresses, etc.

     


  8. Besides the JavaScript, HTML or CSS solutions you can also use the Emulation.setScrollbarsHidden method in the DevTools protocol:

    https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setScrollbarsHidden

     

    If you use CEF4Delphi use this code :

    procedure TForm1.HideScrollbars;
    var
      TempParams : ICefDictionaryValue;
    begin
      try
        TempParams  := TCefDictionaryValueRef.New;
        TempParams.SetBool('hidden', True);
        Chromium1.ExecuteDevToolsMethod(0, 'Emulation.setScrollbarsHidden', TempParams);
      finally
        TempParams := nil;
      end;
    end;

    If you use WebView4Delphi use this code :

    procedure TForm1.HideScrollbars;
    begin
      WVBrowser1.CallDevToolsProtocolMethod('Emulation.setScrollbarsHidden', '{"hidden":true}');
    end;

     


  9. Run the MiniBrowser demo and navigate to that web page. Then click on the top-right button and open the DevTools window.

    Switch to the Console tab, type your JavaScript code and press enter to read the error message :

    document.getElementById("linkRefresh").click();

    The problem could be something as simple as a syntax error or that page could have multiple documents because it could have several frames. In any case, debugging the JavaScript code in the console tab is the best solution before calling WVBrowser.ExecuteScript

×