The web browser control (TWebBrowser) that ships with Delphi XE6 Firemonkey only supports Android and IOS. If you want to use a web browser control in Firemonkey on Windows and Mac one option is the Chromium Embedded Framework (CEF). There are two different versions of the framework for Delphi which are Delphi CEF1 and Delphi CEF3. Both claim to support Firemonkey but I had to have an oDesk developer update CEF3 to support Delphi XE5 Firemonkey (and AppMethod) for me. It had to be modified a bit to run on XE6 and an architecture change was made to allow you to create TChromiumFMX at runtime. I have not tested it on Mac OSX but I believe it will also work there as there is a Mac library in the bin directory. When you use this TChromiumFMX component you will need to copy all of the files from the \cef_Chromium\bin\Win32 directory (or Win64) to whatever the final directory of your EXE file ends up being. You will also need to deploy all of these files with your application. I have two links below. The first one contains the MacOSX, Win32 and Win64 runtime files and the second download has no runtime files. If you already have the CEF3 file from Sourceforge or you have the XE5 version of this component you can download the second version. Here is some sample code for creating it at runtime:
procedure TForm1.Button1Click(Sender: TObject);
var
fBrowser: TChromiumFMX;
begin
fBrowser := TChromiumFMX.Create(Self);
fBrowser.Parent := form1;
fBrowser.Align := TAlignLayout.alclient;
fBrowser.InitializeBrowser; // this line is to add obligatory
fBrowser.Load('http://www.fmxexpress.com/');
end;
Download TChromiumFMX for Delphi XE6 Firemonkey on Windows and Mac (70.2MB).
Download TChromiumFMX for Delphi XE6 Firemonkey on Windows and Mac without Runtime (106k).
This site is very good. I definitely view it everyday. Thanks for the frequent updates and contributions such as this!
Thanks, excellent! Works fine except for some plugins that are not painted/displayed? (all plugins are loaded correctly but nothing is displayed when trying to load a pdf file). Same test case with vcl runs fine.
hi guys.. i have download this component but i can’t use it..
i have to made a simple webbrowser but i need it also in Mac…
i have installed this component but seem it does not work well….
does not load all website…i see only a blank page.
Does it work on Windows or Mac or neither? Do you have the correct library files in the same directory as the executable?
hi.thanks a lot for reply.. i try to explain better.
Now i successed to install component (i think)…
i have made a little form with the component TchromiumFM and if i compile for windows seem ok…
whwn i change the target and try to compile for MacOsx…. nothing to do… the compiler of delphi sais me that it cant found message.dcu… and windows.dcu….. but this dcu are used in windows…. or not?
this dcu are declared in the file ceffmx..
here is part of that code:
as you can see..it call message.dcu, windows.dcu….
unit ceffmx;
{$I cef.inc}
interface
uses
Messages, Windows, SysUtils, System.UITypes, Classes, FMX.Types, FMX.Platform, FMX.Controls,
System.Types, ceflib, cefgui, FMX.Graphics, FMX.Forms, FMX.Dialogs;
Yeah I see those includes. Take a look at this version of the code as it has conditional compilation for Mac:
https://github.com/svn2github/dcef3
TMS Software also has a Mac OSX WebBrowser component in their Firemonkey pack. Basically it uses Chromium on Windows and then I believe it wraps WebKit on the Mac. One WebBrowser wrapper for all 4 native web browser platform controls.
http://www.fmxexpress.com/huge-45-component-suite-for-delphi-xe6-firemonkey-on-android-ios-windows-and-osx/
Dear admin, thanks a lot for your help… it’s very glad..
so..now i will try this conditional compiling….
about tms software i have see and downloaded this component but….. the trial version of webbrowser does not work for windows… and if i try to compile for mac the compiler tell me some errors such as:
[dccosx Fatal Error] Unit1.pas(8): F2051 Unit FMX.TMSWebBrowser.Mac was compiled with a different version of Macapi.ObjectiveC.TOCGenericImport`2.GetOCClass
and not compile…..
the osx on the mac is the last Maverick 10.9.1
thanks a lot one more time 🙂
nothing to do….. i try that file with conditional compile and i received more than 50 others error…so i trye to uninstall package and reinstall all with packega i found where you said me with that conditional compiling but when is installed i cant’ found chromiumFM component…
oh my god.. i don’t know how to do this simple and stupid think…
i need only a simple for with webbrowser that could work in mac…. seem a stupid think but i don’t know how to do….
uffffff
No, my version of ceffmx is modified from the original. You would have to merge in the conditional compilation from the file I linked. I don’t have Mac.
The TMS Firemonkey Pack Browser just works.. just isn’t free. 😛
ya… but before to buy a compoment i’d like to try it… and i speak with tms team and he says that the trial webcomponent does not work… but only the full version…. i mean that they want to buy their product but…. hhow can i buy something if i dont know if it work??
and another think… they said me that for mac also the trial componet work well…but i can’t neither compile it and they answer to me “the full version is ok”…. mmmmmm what have i to think?….. i have to make a simple simple think… spend more than 150 euro for this i think is too much….
i will try thos we with chromium component but i have a lots of problem….
Good point, I’ve got the same issue and I really don’t see the point of trial version and demo when someone can’t see how something works.
Or work at all
but noone knows another way to make this application?..^_^ there no other component such as firefox? or safari?…opera?
I HAVE FOUND THIS… but i dont understand nothing about it…
http://delphimaniacs.blogspot.it/2013/12/firemonkey-twebbrowser-winmac.html
Please see the following web page.
https://github.com/freeonterminate/delphi/tree/master/TWebBrowser
hi,
I have tried to create at run time like you said but I get this error:
E2003 Undeclared identifier: ‘InitializeBrowser’
anything I have done wrong?
any library to use for that?
thx.
sry forgot to delete the previous chromium version src path in delphi library options before adding the new version src path in library. I have deleted the old path and reinstalled the package and its fixed now.
thanks.
Hi.
ok I can create the browser at run time now and it works fine. I only have one problem now if anyone can help, the right-click menues are not appearing for me. right clicking on anywhere on the page does not pop up any menu for me. anyone know how can I fix this ?
Thanks.
I think you have to implement your own right click menu?
hi,
i cant install this package “DCEF_XE5.dpk” in Delphi XE6. i get this error:
[dcc32 Fataler Fehler] DCEF_XE5.dpk(39): F1026 Datei nicht gefunden: ‘C:\Program Files (x86)\Embarcadero\chromium\cef3_ChromiumXE6\packages\ceffmx.dcu’
it means… this file is missing!
and this line in the editor have red background:
cefvcl in ‘..\src\cefvcl.pas’;
how can i solve this?
I’m doing this in XE6. Why is this so hard? I can’t install anything without an error. bpl file? Whats the trick? Step by step..
What is the error?
I build DCEF_XE5.dpk. Then install it. It says Chromium in the packages. But when I pull up the Browser.pas from the demo it says
Class TChromiumFMX not found. I know I’m doing something stupid. I just lost.
I build DCEF_XE5.dpk. Then install it. It says Chromium in the packages. But when I pull up the Browser.pas from the demo it says
Class TChromiumFMX not found. I know I’m doing something stupid. I just lost.
When I get in packages and look at Chromuim and look at installed components nothing shows.. none of the stuff in cefreg.pas .. TChromium, TChromiumOSR, TChromiumFMX
You downloaded my modified version ( http://www.fmxexpress.com/wp-content/uploads/ChromiumXE6.7z ) and it says that? That is the error I use to get if I use the package straight off their website. My version is modified to fix that problem.
You left ceffmx.pas out of DCEF_XE5 in the Contains linr
You have to manually add the cef3_ChromiumXE6\src directory to the Project Search Path.
it is … got that all working, I think .. now when I compile The browser demo program it says it can’t find ceffmx.dcu
It has both ceffmx and ceflib underlined in red like it can’t find them..
it also underlines TChromiumFMX in the ChromiumFMX1: TChromiumFMX; line under type
Ok, I got it running.. still way too hard to do..but working well, really like it.. Thanks .. mack
Thanks, very much!
I have installed in XE7 succeed.
But how to embed the pop window to the fmx form in the OnBeforePopup event?
Thank you very much 🙂
how to install 64bit?
Delphi XE8 has a built in TWebBrowser that probably supports 64bit. Also TMS Pack for Firemonkey has a ChromiumFMX version that it uses. It may support 64bit. Download it’s trial: http://www.tmssoftware.com/site/tmsfmxpack.asp