Hello,
Thank you for TTMSFMXWebBrowser! Great job!
But what do You think about add some functions to it:
1. GetTagValue method - get attribute value of HTML element by ID
(Example:
FWebView:=FMX.WebBrowser.TWebBrowser(Browser.NativeBrowser);
Result:=FWebView.GetTagValue(iTagName,iValueName);
)
2. GetTagValue - get innerHTML value from element by ID
(I don't know how to do now, maybe You know?)
3. Print method
(Example: Browser.EvaluateJavaScript('window.print()');)
4. Get source of loaded page
(I don't know how to do now - maybe You know?)
Karol
Hi,
We have exposed the very basics in order to have a working webbrowser for Windows without the hassle to modify source code and install TChromiumFMX. There are some good suggestions, but we still have a lot of work to investigate these features, and before we expose them we also need to make sure that they are working for all supported platforms.
Kind Regards,
Pieter
Hi,
I would like to use Your FMX.TMSWebBrowser.Mac.pas in my project, but all code You put only in implementation section. Could You move declaration to interface section?
Above I wrote simple code for get Tag value. It works only on Windows. Below is my code for Windows & OS X. But I need use Your WebView class, so I move declaration to interface section in FMX.TMSWebBrowser.Mac.pas file.
function GetTagValue(const iTagName, iValueName: String) : String;
{$IFDEF MSWINDOWS}
var FWebView : FMX.WebBrowser.TWebBrowser;
{$ENDIF}
{$IFDEF MACOS}
var FWebView : WebView;
Res: NSString;
{$ENDIF}
begin
{$IFDEF MSWINDOWS}
FWebView:=FMX.WebBrowser.TWebBrowser(Browser.NativeBrowser);
Result:=FWebView.GetTagValue(iTagName,iValueName);
{$ENDIF}
{$IFDEF MACOS}
FWebView:=TWebView.Wrap(Browser.NativeBrowser);
Res:=FWebView.stringByEvaluatingJavaScriptFromString(StrToNSSTR('document.getElementById("' + iTagName + '").' + iValueName));
Result := String(Res.UTF8String);
{$ENDIF}
end;
Karol
Hi,
We have moved the interface declarations above the implementation, the next version will have this included.
Kind Regards,
Pieter