On iOS it was really easy, the UIWebView renders them (office files). But, on the OSX side, the WebView does not do that. Is there any other class may I use?
Related
So I'm trying to migrate from using UIWebView to WKWebView for Xamarin Forms iOS but I have a few questions because this all seems to be pretty new and none of the resources are helping me online.
https://github.com/xamarin/Xamarin.Forms/pull/7367
I came across this link though, and apparently the WKWebview is not the default for Xamarin.Forms for 4.0+ and so,
1) I'm currently using Xamarin Forms 3.4.0.x. From my understanding, is all I have to do to get the WKWebView upgrading to 4.4.0.991477, the latest build?
2) Follow up to question 1, how would I not change any code because my cs files contain "using UIKit", which is the namespace for UIWebView, is it not?
3) In this link, it seems like there is no design change at all.. but I thought that WKWebView contained a URL link at the top of the page, which UIWebView does not, which is correct?
Thanks!
1) If you have only cross-platform code, then yes there is nothing that you need to worry about, it just works.
2) As you suggest that you have UIKit in your code, then obviously that won't work. UIKit is not Xamarin.Forms API and basically you don't use Xamarin.Forms in this case, but rather Xamarin.iOS.
3) Neither of those controls display URL.
Apple's documentation suggests using WkWebView for new development, although it seems to have a typo where it recommends WKWebView over UIWebView in the mac developer library.
For new development, employ this class instead of the older UIWebView class.
The typo is probably because they are trying to unify the OSX and iOS interface to the web view by using the same header for both.
However, WKWebView doesn't have all the functionality that WebView has in OSX. For example, you can get access to DOM nodes in the native interface in WebView but I don't see any way of doing this from Swift/Objective-C in WKWebView.
For my purposes, it seems like WebView is what I need, but I'm weary of starting a project that relies on an API that will be removed. However, I don't see any mention of intent to deprecate WebView anywhere in the headers or the documentation.
What makes this even more confusing is the WebKit Framework Reference makes reference to both WK and older web view APIs without clarifying anything.
WKWebView
A WKWebView object displays interactive web content, such as for an in-app browser.
WebView
WebView is the core view class in the WebKit framework that manages interactions between the WebFrame and WebFrameView classes.
Is WebView going away in OSX?
Its not a false alarm. Apple moved Safari off of UIWebView/WebView in 6.0, so security fixes simply aren't happening in the old class as much. For that reason alone you should not use it for new stuff. Apple has been incrementally improving it with every OS release so much is now do-able with private extensions (file:// access, downloads, etc)
That being said, it won't be fully equivalent to old WebView. You can't directly access the DOM anymore because the Network/Rendering/UI processes were split up and you create locks by making element references like that. Use the postMessage() message handler and wkwebview.evaluateJavaScript() and callback-ish/promisy JS code between those two pillars to deal with web<>native interaction asynchronously.
Important
Starting in iOS 8.0 and OS X 10.10, use WKWebView to add web content to your app.
Do not use UIWebView or WebView.
https://developer.apple.com/documentation/webkit/wkwebview
Is it possible to use a Chromium webview instead of the native webview on OSX?
I am guess it is a products like Sencha Desktop Packager exist.
As far as I can tell there drop no convenient libraries/wrappers, but most searches for OSX dev return results for a certain handheld device.
Note
So far I have found CEF and CEFSimpleSample
It's possible to use a Chromium webview instead of a native webview. But the documentation to code such a thing is very rare and poor.
The Chromium Embedded Framework Forum is a good place to ask questions.
I would highly recommend you to alter the CEFSimpleSample because there is a "Chromium Webview" included which works.
How can I embed a WebView (Embedded Web browser) inside a Delphi MacOS application?
It does not appear the webkit headers are included in XE2.
Have you tried the TWebBrowser control? This control works in the iOS environment and you can simply set it's URL or use the Navigate function.
Have you looked at Chromium Embedded Framework? It might be kinda heavyweight if you just want a view with some HTML, but they have bindings for Delphi. You get access to an up to date chrome webkit/blink browser with V8.
Our Mac desktop application embeds WebView component from WebKit framework.
Inside WebView we host Flash Player where we render UI.
As far as I know, Safari uses WebKit/WebView to display the content.
We were expecting Safari to host the same WebView component our application hosts.
In other words, if Flash plugin is installed in Safari, than Flash will be available in our WebView.
Unfortunately this appeared to be wrong for one of our users.
On his Mac, Flash runs flawlessly in Safari, but our WebView displays "Missing Plugin" message in place of Flash Player.
Mac OS X 10.5.8
Why this can happen?
Is it possible Safari to use a different WebView (or WebView settings) than our application is using?
I would appreciate any advice that would help us to find the source of the problem.
I have asked the user to run a small script that prints a set of plugins installed for Safari and for our WebView.
There are around 20 plugins installed in Safari, including Flash Player.
But there are only 3 plugins installed for our WebView.
Here they are:
Java Plug-In 2 for NPAPI Browsers
Switchable Java Plug-In for WebKit
RealPlayer Plugin.plugin
Pasha
Is it possible Safari to use a different WebView (or WebView settings) than our application is using?
Yes, very much so. A WebView is simply a class, and Safari uses one instance of such a class, which doesn't get modified for a plug-in. The Flash plug-in is installed for the browser (as in, Safari keeps track of where it is installed and looks for it as necessary). Cocoa's WebView doesn't get modified whenever a plug-in is installed—that could lead to all sorts of issues.