Re: questions on WebView for Mac apps
Re: questions on WebView for Mac apps
- Subject: Re: questions on WebView for Mac apps
- From: email@hidden
- Date: Wed, 30 Sep 2015 18:19:44 +0900
> On Sep 30, 2015, at 3:12 PM, Jens Alfke <email@hidden> wrote:
>
> Hey, if I liked working with JavaScript DOM APIs I’d be a web developer :-p
> I prefer languages with fancy features, like warning me if I pass the wrong number of parameters to a function. At build time, even.
No disagreement here. None at all.
>
> In a hybrid app you’re going to need to have some communication between the web code and native code. But WKWebView hasn’t done much to enable that. On the JS side you have some really limited events you can trigger, and on the native side you can glom your stuff into a string of JavaScript code and pass it in to be evaluated ― which isn’t just a PITA, it’s also very, very prone to injection attacks if you don’t quote everything correctly.
There is at least cross site policy, but it's true JavaScript can snoop on JavaScript.
>
> You also can’t generate your own resources, except for a single HTML page. Any resources loaded from that page have to have ‘real’ URLs, and any navigation from that page goes to ‘real’ URLs. There’s no way to intercept and override the loads, or register your own URL protocol. The workaround is to run a real live in-app web server, listening on a real live TCP port. This also has some serious security implications, even if you only bind it to localhost.
It's feels the API is just for the apps that wrap web sites lamely right now.
At the end of the day most hybrids trying to use web for easy UI are missing all the hard stuff native gives free. Accessibilty and Localization facilities come to mind first.
But people keep trying to do it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden