7

Has anyone successfully used WebKit in Delphi?

WebKit is an open source web browser engine. WebKit is also the name of the Mac OS X system framework version of the engine that's used by Safari, Dashboard, Mail, and many other OS X applications.

I want to create an iPhone/iPad Mobile Simulator same as in electricplum. (I have tried the FREE version - seems like it also uses Adobe AIR).

With Safari browser we have the most accurate preview results for iPhone mobile sites. so I would like to embed the WebKit (that is used by Safari) in my application, so my customers can have a reliable preview of their mobile web sites.

I have searched the web, but could not find a working code. (The best I could find was this, but it's not working).


The 3 main problems with Delphi Chromium Embedded suggested in the answers are that:

  • It does not support D5
  • I can overcome the fact that there is no support for D5 (creating the component with D7 in a separate process or DLL) But, It is very unstable! I have tested it with D7: Random access violations.
  • It does not render HTML pages with div layout/HTML5 same as Safari does (or electricplum - "Electric Mobile Simulator").
kobik
  • 21,001
  • 4
  • 61
  • 121
  • 1
    WARNING: The provided link to the Safari code in the board message of bsalsa.com is reported as dangerous (the link to _http://www.simail.si/download/Delphi_Webkit.7z). DON'T DOWNLOAD IT! – Codebeat Oct 21 '12 at 13:44

2 Answers2

7

Have a look at DelphiChromiumEmbedded. It's not Safari, but it is Webkit based at least...

Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
  • 2
    @kobik ChromiumEmbedded is pretty much your best bet... however I see you have a D5 tag there... not sure if you'll be able to use it without some changes... –  Mar 06 '12 at 19:27
  • 1
    I have tested Chromium. as I thought, it is based on Google chrome engine so it renders the HTML like chrome (which is not what I want) and does not use [WebKit](http://www.webkit.org/). It is also very unstable. – kobik Mar 08 '12 at 10:26
  • 2
    @kobik: I was under the impression that Chrome *did* use Webkit. And Wikipedia says it does... – Mason Wheeler Mar 08 '12 at 17:12
  • 1
    @MasonWheeler As I understand it, Chrome uses WebCore (part of WebKit), but doesn't use WebKit's JavaScript engine, having replaced JavaScriptCore with V8. –  Mar 11 '12 at 13:15
  • 2
    chrome basically is webkit =) – Sebastian Flückiger Mar 11 '12 at 13:27
  • I'm accepting this answer since I have to accept one. maybe in the future Chromium will be stable... – kobik Apr 11 '12 at 10:17
3

The reliability of that is not going to be very good. In a corporate environment you might want to just put a mac on the network with the iPad/iPhone simulator from xcode, and script it to open your site and take screenshots.

Or even write a iOS program to open a webkit view with your site, and just put an iPad on the network.

And take a look at this question and answer

You might want to consider how much work a delphi webkit is going to be compared to just buying a mac. The upgrade cycle is going to be painful whatever route you take, but quality is going to be much better with the mac/iPad.

Community
  • 1
  • 1
Stephan Eggermont
  • 15,847
  • 1
  • 38
  • 65
  • Thanks for your response. As I mentioned, Safari on Windows gives us *very good* results. In fact our design team is using ["Electric Mobile Simulator"](http://www.electricplum.com/) with great success. But I want to embed that inside our product. – kobik Mar 18 '12 at 11:33
  • +1 BTW. That gave me an interesting idea... maybe there are already exists reliable web-services based on iOS, that will get an input of the URL, and return a PDF... – kobik Mar 18 '12 at 11:50
  • 3
    comment to @Self: using a screenshot is problematic, because the screenshot is not responsive. meaning I can't actually navigate and actually see transpositions effects for example. – kobik Mar 18 '12 at 12:13
  • On a mac/pc you could use vnc/ichat/skype/remote desktop or so to capture screen semi-live. If your connection is good enough (and the machine fast enough) you should be able to have no dropped frames – Stephan Eggermont Mar 18 '12 at 18:49