Sign in Join
Wiki copytemporary

GeckoPort version2

English · Español

About

GeckoPort is a Lazarus/Free Pascal version of Takanori Ito's Gecko SDK for Delphi, including the TGeckoBrowser component. Version 2 is based on automatically generated include-files from the idl files from the Gecko SDK. For this purpose the idltopas utility is used. This way it's earier to follow the fast Gecko-release cycle now gecko-developers do not maintain backwards compatibility anymore. You can find more information about the old version of GeckoPort here.

Current sources are based on Gecko 9, as Gecko 10 has a bug preventing it from being embedded.

Screenshots

License

MPL 1.1

Installation

There is a fpmake-package for GeckoPort in the Free Pascal repository. To install the geckoport fpmake-package on your system:

bash
fppkg install gecko

To compile a sample app:

Note that you'll need the Gecko libraries installed before you can run one of the sample apps. If necessary, use an installer from here:

 https://developer.mozilla.org/en/XULRunner

Development

You can download the sources from the GeckoPort from the Lazarus-ccr using Subversion:

bash
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/geckoport/version2 [local dir]

To install this version, go to the (local) source-directory and use

bash
fppkg install -o -gl

The '-o -gl' parameters are to include debug-info.

To Do

Win32 widgetset

The ChromeWin and GBrowser sample apps work the same as they do with Delphi.

Currently the code looks for a xulrunner in the following order:

With Free Pascal 2.4.x and 2.5.1 on Windows, you must disable floating point exceptions as soon as possible in your program. Add the Math unit to your uses clause and add the following statement at the beginning of your program:

pascal
SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]);

Note that this will disable floating point exceptions in all code, not just in the Gecko libraries. See the sample app .dpr files for examples of how to add this code.

Firefox runner is now working, tested with Firefox 3.6.12 but the application exe MUST be in the same folder as Firefox or you will get a hangup now of them.

Carbon widgetset

A native window must be passed in to initialize the browser component. On OS X, this must be a Cocoa window, otherwise the Carbon widgetset will not work.

Cocoa widgetset

Although the Cocoa widgetset currently has support only for TForm and one or two other controls, the ChromeWin sample app can be run with the Cocoa widgetset since this app uses only TForm.

Note that the GeckoPort package now uses the new Objective Pascal-based Cocoa widgetset instead of the old PasCocoa-based widgetset. To compile the ObjC-based Cocoa widgetset, you will need a version of FPC that includes Objective Pascal support (for example, version 2.6 or higher, or compiled from FPC SVN trunk).

You will also need to set the app's widgetset to Cocoa, since the default is Carbon. Or you can compile ChromeWin.lpi with lazbuild and specify the --ws=cocoa switch. See the lb-cw-cocoa.sh script for an example.

To run the ChromeWin sample app, you need to set DYLD_LIBRARY_PATH so that the XUL library can load the other Gecko libraries it depends on. A simple way to do this is to start ChromeWin.app with the included run-cw-mac.sh script. Note that this script assumes that you have the XUL.framework installed.

The GBrowser sample app will crash because of the current incomplete state of the Cocoa widgetset.

GTK2 widgetset

On Linux, be sure to set the LD_LIBRARY_PATH environment variable to the xulrunner directory before running one of the sample apps. For example:

bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/xulrunner-1.9.1.4

The Gecko detect code in Linux gets the LD_LIBRARY_PATH environment variable and looks for a suitable XULRunner which path is in it.

Currently sample apps works in Linux/Ubuntu 9.04 using Lazarus 0.9.29 and fpc 2.5.1 with some paint problems that I think will be resolved soon and seems to be related to GTK2 interface.

Please report testing success or failure to the GeckoPort maintainer:

 "José Mejuto" joshyfun (at) gmail (dot) com (Current maintainer)
 MacPgmr (at) fastermac (dot) net (Original maintainer)

See also


From the Free Pascal wiki, page "GeckoPort version2", as it stood on 2020-02-16 after a change by GAN, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 5, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.