TAdvWebbrowser - form data and dragging

Hi,

  1. saving and restoring form data in TAdvWebbrowser, including passwords. Possible?

  2. drag selected text of body to another control. Doesn't seem to work. What am I doing wring?

Many thanks in advance
Alfons Glasmacher

  1. This is possible, add AdvWebBrowser1.AutoClearCache := False; in the form constructor.
  2. Which control are you referring to? Note that drag & drop from the browser to the form / control might fall into the OLE drag drop category, and this is not enabled by default in VCL. You might need to investigate a custom implementation for this. Dragging and dropping from the browser to Word or NotePad works as expected. (Drag Drop via Ole - Windows API - Delphi-PRAXiS [en])

Thank you for your answer Pieter.

1 Like

Oh sorry...
the control I want to drag to is a simple TEdit

Yes, this will require OLE drag & Drop implementation.

Ok, thank you.

As I'm so lazy, I asked a component of drag&drop component suite to assist me ;-)
That did the trick.

Perfect, thank you.

btw ... AutoClearCache set to false keeps the username of a login form, but not the password. Any way to achieve this too?

Hi,

It should prompt to save the password.

Unfortunately it doesn't.
Any egde setting that prevents this?

Yes, you can use this

uses
  AdvWebBrowser.Win;

procedure TForm1.AdvWebBrowser1Initialized(Sender: TObject);
var
  c: ICoreWebView2Controller;
  w: ICoreWebView2;
  s: ICoreWebView2Settings;
  s4: ICoreWebView2Settings4;
begin
  c := ICoreWebView2Controller(AdvWebBrowser1.NativeBrowser);
  if (c.get_CoreWebView2(w) = S_OK) and (w.get_Settings(s) = S_OK) and (s.QueryInterface(IID_ICoreWebView2Settings4, s4) = S_OK) then
    s4.set_IsPasswordAutosaveEnabled(True);
end;

Perfect. Works.
Thank you

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.