TTMSFMXWebBrowser problems (Win32 and iOS)

- Win 8.1
- RAD 10 Seattle Update1
- TMS Pack for FMX (in version history no changes for TMSFMXWebBrowser in
- iOS 9.2.1 (both iPad/iPhone and Simulator)

Problem 1, iOS (most <span -align="0:26">significant), steps to reproduce:
1. Create new multi-device app,
2. Put TTabControl on form with Align = TAlignLayout.Client
3. Add 2 TabItem
4. On first tab put some controls (anything - button, label, etc - this is <span -align="0:17">doesn't matter).
5. On second tab put TTMSFMXWebBrowser, Align = TAlignLayout.Client
6. In TabControl.OnChange event write this code:
   if TabControl1.TabIndex = 1 then

Launch app on iOS device or Simulator and try switch between tabs. When you select Tab2->Tab1, TMSWebBrowser not hided. Standart TWebBrowser hides correctly.<span -align="0:17"> It's very strange :)

Problem 2, Win32, steps to reproduce:
Do same as described in Problem 1, but on the frame, main form must be empty.
in MainForm.OnCreate write:
  fr: TFrame;
  fr:=.TFrame1.Create(nil); // Access Violation in FMX.WebBrowser.Win.pas

I understand, what Problem 2 in standart TWebBrowser code (trying access Form.Handle while Form = nil). <span -align="0:30">How can I work around this ?


For issue 1, you will need to manually hide the TTMSFMXWebBrowser. For TWebBrowser an internal mechanism is executed, which does not work for other controls. 

For issue 2, can you try by passing Self as owner instead of nil?

Hi, Pieter!

For #2 - yes, i tried to pass Self and Application as Owner. Same exception. Both for TWebBrowser and TTMSFMXWebBrowser, because they use same FMX.WebBrowser.Win.

For #1 - as i know, both TWebBrowser and TTMSFMXWebBrowser uses native control on Android and iOS platforms. So "in depth" there are no difference between them (?). It turns out that i need in OnChange event check current active Tab, describe, contains this tab WebBrowser or not, show "current" WebBrowser and hide others? Too much action... And what about Tab slide animations (TabControl.SetActiveTabWithTransition)? There is not good to hide control before it "slides".

For Issue 2, If the issue is reproducible with TWebBrowser then it is unfortunately an issue in FireMonkey. Since the TTMSFMXWebBrowser inherits from TWebBrowser the issue needs to be fixed on TWebBrowser level.

For Issue 1. The action that is needed for changing tabs is setting the visible property to false manually. As you can notice in the unit FMX.TabControl.pas it includes the unit FMX.WebBrowser

and executes the code below:

procedure TTabControl.WebBrowserRealign(Sender: TObject);
  BrowserManager: IFMXWBService;
  if TPlatformServices.Current.SupportsPlatformService(IFMXWBService, BrowserManager) then

Other than provide our own TabControl that handles this there is no workaround of this issue.

Issue 2 - i didnt say, that the error in TMS code :). But since TMSFMXWebBrowser uses standart FMX code, may be you know, how i can avoid this. If not - well, this issue not matter to me. I found it when i try reproduce issue 1.<br><br>Issue 1 - wow, i didnt know this. Looks like big workaround in FMX. Ok, i think, that provide new TMSTabControl only for this issue - is not good idea.
Well, i have to continue to use standart TWebBrowser. But it contains very poor code for load links like 'file://' - it causes SegFault/AV sometimes on iOS platform...

Thanks for your explanation!