SimpleBrowser example project won't run in 64-bit

The HTMLViewer is dead simple. I tossed one into a window as a test of something else and never expected it to not work… but it didn’t. I reviewed my code and compared it to the sample code in the language reference. All good. Still wouldn’t work.

I then opened up the SimpleBrowser example project that ships with Xojo 2019 Release 1… I did nothing to the code and attempted to run it as is… didn’t work.

I’m using Xojo on a MacBook running Mac OS X 10.11 (which should totally be able to run 64-bit everything, right?) but on a whim, I decide to change the build settings from 64-bit to 32-bit, ran the project and… I’m looking at wikipedia!

Is this a bug? Anyone have any idea why this simple control won’t operate in 64-bit?

SimpleBrowser example works here with macOS 10.12.6

Can you change the WebViewer Behavior from Native to WebKit to see if that changes anything?

Data point:
Working correctly 64 bit Mac OS 10.14.4

[quote=436168:@Alberto De Poo]SimpleBrowser example works here with macOS 10.12.6

Can you change the WebViewer Behavior from Native to WebKit to see if that changes anything?[/quote]

Actually, I tried that first. Didn’t help.

Data point:
I’m running Mac OS X 10.11.6 on a MacBook Pro (13-inch, Mid 2009)

…hmmmm… I’ve been looking for an excuse to buy a new laptop… I’m not sure that this qualifies but it’s one more straw…

[quote=436168:@Alberto De Poo]SimpleBrowser example works here with macOS 10.12.6
Can you change the WebViewer Behavior from Native to WebKit to see if that changes anything?[/quote]

On a mac, HTMLViewer.Renderer has no effect.

I wonder if you are hitting a security restriction? - try adding these keys to your app’s plist:

 <key>NSAppTransportSecurity</key>
 <dict>
  <key>NSAllowsArbitraryLoads</key>
    <true/>
 </dict>

this is all documented here: https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33 note that 10.11 is older and some of the options in 10.12 and higher will override these.

on macos 10.11.6, running xojo 2019r1
opened the simplebrowser example, verified it is on 64 bits compile, run it, and I’m on wikipedia.
so it must definitely be something else on your computer. antivirus ? firewall ?

Jean-Yves, can you try both HTTP: and HTTPS: urls? If I’m right, it will fail with HTTP but work with HTTPS. If not, may be something else going on.

Had no effect here on 10.14.4. Transport security does not affect debug it seems.

works the same with http or https on my computer.
in fact it redirects to https if you type http (but you don’t see it in the address bar I see it in my firewall)

http vs https makes no difference here either…

To be clear, I do not have to actually build the app in order to reproduce this. Simply running it in the debugger is enough. Leave the build setting for Mac OS X at 64-bit and it doesn’t work. Set it to 32-bit and it works.

Just after I wrote this, I went in and loaded up SimpleBrowser again… and it worked on 64-bit. Huh?! I must be losing it. I swear it didn’t work before.

So, I loaded up my own little Web Browser app that is almost a complete copy of the SimpleBrowser app and same as before… it doesn’t work on 64-bit but it does work on 32-bit. I wonder if it has anything to do with the project file having been created in different versions of Xojo?

I’ve moved on. I actually don’t even need HTMLViewer in my project. I was just using it to test something. I just wanted to share this little mystery with the group in case someone else ran into it.

Side Note: Did some testing on AppTransportSecurty the other night with a customer. It seems pretty unreliable in my experience. IE: Loading an image from HTTP in to an HTMLViewer in 10.14.4 would work sometimes on my setup, but not his and vice-versa. Once we both included the necessary info.plist to lift all restrictions, neither of us had an issue.

What version of Xojo? When you say doesn’t work. What does it do?