Skip to content

Latest commit

 

History

History
110 lines (70 loc) · 8.79 KB

webview-alternatives.md

File metadata and controls

110 lines (70 loc) · 8.79 KB

Notes on Webview Alternatives

Date: 2015-09-10
Google: phonegap webview

Notes on the webviews used by Cordova/Phonegap are here

Cordova/PhoneGap is an application container technology that allows you to create natively-installed applications for mobile devices using HTML, CSS, and JavaScript.

The UI (user interface) for PhoneGap applications is created using HTML, CSS, and JavaScript. The UI layer of a PhoneGap application is a library - colloquially known as webview. It uses up to 100% of the device width and 100% of the device height

Think of webview as a "chrome-less" web browser. It renders HTML content, without the "chrome" or window decoration of a regular web browser. You build your application to take advantage of this space, and you build navigational/interactive/content elements and the application chrome into your HTML and CSS based user interface.

On iOS, this is the Objective-C UIWebView class; on Android, this is android.webkit.WebView.

NOTE: Some of these libraries are based on WebKit. However, WebKit allows customization. This means not all features apply to all browsers that use WebKit as there base.

Google: webview alternative

Webview Alternatives

  1. Crosswalk an x86 version of the plugin to PGB: https://build.phonegap.com/plugins/4652
  2. WKWebView an alternative for iOS
  3. cordova-plugin-safariviewcontroller another alternative for iOS. One developer described it as such, I have not tryed it yet. Looking into the open issues, I think only one of them makes sense, it doesn't have events (loadstart, loadstop) like inAppBrowser

As of this moment, there are 13 webview alternatives available on NPM; many are clones of one or two base sources.

Webview Alternatives NOT NPM

  1. cl.kunder.webview - This webview is totally independent from the main webview, but allows you tu access plugins and other Cordova resources. (sic)

Work in Progress

  1. WinRT XAML Toolkit - work in progress (last update may 2014) for Windows Runtime using XAML supports Windows 8+

Available, but Not Useful

  1. GeckoView - As mentioned in the project page, we don?t intend GeckoView to be a drop-in replacement for WebView. Internally, Gecko is very different from Webkit and trying to expose the same features using the same APIs just wouldn?t be scalable or maintainable.
  2. Zirco - an open-source alternative browser for Android. The code is READ-ONLY mode. The browser itself is still available on Google Play.
  3. JavaFX - A tutorial entitled Adding HTML Content to JavaFX Applications
  4. WebView QML Type - This is a webview library, but ther are no indications this has been ported to Android or other mobile systems.
  5. SFSafariViewController - It shares cookies and other website data with Safari, and has many of Safari's great features, such as Safari AutoFill and Safari Reader. iOS, noticed with iOS9 SEE

Important Articles

Notes on different ways to extend the API for a given webview library. Includes notes on some libraries not included here.

Important Articles Regarding iOS

Important Articles Regarding Android

Android 4.4 (API level 19) introduces a new version of WebView that is based on Chromium. This change upgrades WebView performance and standards support for HTML5, CSS3, and JavaScript to match the latest web browsers. Any apps using WebView will inherit these upgrades when running on Android 4.4 and higher.

Note: If your targetSdkVersion is set to "18" or lower, WebView operates in "quirks mode" in order to avoid some of the behavior changes described below, as closely as possible?while still providing your app the performance and web standards upgrades. (...)

iOS 8 finally gave developers access to a WebKit-powered Web view, called simply WKWebView.

Previously, the much slower UIWebView was the only tool at an iOS developer?s disposal, but the new WKWebView allowed us to bring users the same 60fps high-performance browsing behind mobile Safari.

If you are trying to build your own app, then this is what you came here for. Who cares about this paragraph, just give me the code samples. I know how it is. That?s why I included COMPLETE examples, instead of just bits and pieces.

The WebView view uses the internal WebKit engine to display Html pages. The page displayed can be an online page loaded with LoadUrl or an Html string loaded with LoadHtml.

Important References

  1. ECMAScript 5 compatibility table
  2. browser compatibility cheat sheet
  3. Optimizing content for different browsers: the RIGHT way
  4. How to Make All Browsers Render HTML5 Mark-up Correctly