Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Talk:FAQ How do I display a Web page in SWT?

mac os: disable ATS

Mac OS has "App Transport Security" that prevents opening http pages, and this happens with the swt browser even on the local network if server names are used (ip works). During development there is no Info.plist where this can be disabled in principle, but also this didn't work here, possibly an issue with java launcher scripts. In any case, one might want to disable ATS dynamically, this works but it was a bit hard to figure out, possibly it's useful for SWT FAQ or here? Sorry, I forgot: this is in kotlin, can make java easily.

   val ats = org.eclipse.swt.internal.cocoa.NSDictionary.dictionaryWithObject(
           org.eclipse.swt.internal.cocoa.NSNumber.numberWithBool(true),
           org.eclipse.swt.internal.cocoa.NSString.stringWith("NSAllowsArbitraryLoads"))
   org.eclipse.swt.internal.cocoa.NSBundle.mainBundle().infoDictionary().setValue(
           ats, org.eclipse.swt.internal.cocoa.NSString.stringWith("NSAppTransportSecurity"))

Back to the top