I have a multi-platform app that runs on Window/Android/32-bit Mac. I added the 64-bit MacOSX platform today to test it out.
The application compiles and runs (no code changes), however the TWebBrowser component is broken with 64-bit.
When compiled and run as 32-bit, it displays web pages fine. With 64-bit, even the simplest http://... web pages are not displayed (no error reported).
It will display local html files, using the syntax, for example: WebBrowser.URL:='file://'+ResourceFolder+COMMANDSURL;
Any ideas? A bug maybe? Perhaps the mac firewall is preventing external addresses?
In testing this some more with a simple application, it appears as though the 64-bit version will not render a non-SSL (https://) web page. The same code compiled 32-bit run on the same MacBook works find for http:// web pages. This is MacOS 10.13. At the very least if this is a limitation imposed by the Mac, this could be stated in the TWebbrower docs.
Add this to your Info.plist file:
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
Relaunch the app and you'll be able to load any URL.
Dave Lane said:At the very least if this is a limitation imposed by the Mac, this could be stated in the TWebbrower docs.
Well, I'd say that in this particular case, Embarcadero is innocent. They cannot and shouldn't explain all the peculiarities of the macOS API. They are culpable for far worse things. Take, for example, the TWebbrower class. It should have been re-written many years ago, because the Cocoa WebView class has long been deprecated. Instead, WKWebView should be used.
Thanks very much for your reply. This resolved the problem and the app now runs properly on macOS 64-bit!