Hi,
Is there any possibility to create own popupmenu and second question: how to paste from clipboard (by code) to form field on web page (like by standard Ctrl V). I need to write helper app which simplify forms fill, by prepare popup menu with predefined paste values taken from database.
Best Regards
JG
Pieter
(Pieter)
March 7, 2022, 10:34am
2
Take a look here: Using Own popupmenu with TadvWebBrowser Popup - #4 by Pieter_Scheldeman
The sample is for TAdvWebBrowser, but the code should be the same, as TAdvWebBrowser and TTMSFNCWebBrowser are identical.
For pasting from the clipboard, you can use the technique described here (it requires you to know the element IDs)
Hello
Sorry, I got confused, it was about a TEmbeddedWB, (EmbeddedWB1.Paste;)
but I have also done it with the TChromium component with the Chromium1.ClipboardPaste procedure;
It could be paste or also write, it is to fill in the username and password field of the bank and card pages
Unfortunately this is not the case. Thank you for popupmenu tips. Please let me know if any solution for "paste" will be available.
Without knowing id (but still not as good as Ctrl V):
s := 'document.activeElement.value = "test";';
fnc_www.ExecuteJavaScriptSync(s);
s := 'document.activeElement.dispatchEvent(new Event("input", { "bubbles": true }));';
fnc_www.ExecuteJavaScriptSync(s);
s := 'document.activeElement.dispatchEvent(new Event("change", { "bubbles": true }));';
fnc_www.ExecuteJavaScriptSync(s);