Skip to content
This repository has been archived by the owner on Dec 13, 2017. It is now read-only.

Switch to WKWebView instead of UIWebView #260

Open
bummytime opened this issue Sep 26, 2014 · 16 comments
Open

Switch to WKWebView instead of UIWebView #260

bummytime opened this issue Sep 26, 2014 · 16 comments

Comments

@bummytime
Copy link
Member

Title has it. This is an iOS 8 only api, but we could consider regressing to UIWebView for iOS 7 users.

Marketing blurb:

WKWebView is the centerpiece of the modern WebKit API introduced in iOS 8 & OS X Yosemite. It replaces UIWebView in UIKit and WebView in AppKit, offering a consistent API across the two platforms.

Boasting responsive 60fps scrolling, built-in gestures, streamlined communication between app and webpage, and the same JavaScript engine as Safari, WKWebView is one of the most significant announcements to come out of WWDC 2014.

@bummytime bummytime added this to the Release 4.7 milestone Sep 26, 2014
@bummytime
Copy link
Member Author

Mattt Thompson has a nice breakdown of it here: http://nshipster.com/wkwebkit/

@sendhil
Copy link
Contributor

sendhil commented Sep 30, 2014

I think this is worthwhile as there's a good chance we'll drop iOS 7 support.

@diegoreymendez
Copy link
Contributor

This is a status message posted by @SergioEstevao in an initial/tentative PR. I'm posting this here for context:

Trying to upgrade the uses of UIWebView to WKWevView, here a list of main issues to solve:

  • Port the hack to have a read/write customAccessoryView from UIWebView to WKWebView
  • Remove unnecessary hacks (EDIT by Diego: let's leave this for v2).
  • Make custom fonts load in the web view, because it looks it does;t have access to system ones.
  • Port javascript html schema callbacks to use WKUserContentController (EDIT by Diego: let's leave this for v2)

@diegoreymendez
Copy link
Contributor

Custom fonts are now loading in the web view.

@diegoreymendez
Copy link
Contributor

I'll be implementing native callbacks in a separate branch named feature/260-wkwebview-native-callbacks. That way we can either decide to merge them as part of this PR or in a separate one.

@diegoreymendez
Copy link
Contributor

When integrating this into WPiOS we have these issues:

  • When posting, the last character typed is not saved.
  • Can't update a post after editing it - the button remains greyed out.

@astralbodies
Copy link
Contributor

@diegoreymendez
Copy link
Contributor

@SergioEstevao - Changing back and forth from source mode to regular mode should be working fine now. I just applied a fix for the issues you were seeing.

@diegoreymendez
Copy link
Contributor

Fixed the remaining issues we'd found. Will keep testing before creating a PR.

@diegoreymendez
Copy link
Contributor

Fixed an issue with device rotation by removing an old hack that seems not to be necessary anymore. Ping @bummytime to confirm.

@diegoreymendez
Copy link
Contributor

@rachelmcr, @bummytime: Added several fixes for the focusing issues and recovery. Also added a fix for the input accessory view issues when using an iPad.

More specifically:

  • The focus should now return after adding images.
  • The input accessory view should now be visible when using an iPad.

@diegoreymendez
Copy link
Contributor

Due to limitations in WKWebView, we're putting this idea on hold for now.

In particular we're not able to present images from private blogs, as there's no mechanism to add authentication cookies to those requests.

We'll keep this issue open and branch feature/260-wkwebview will be kept updated in case we find a solution for this problem.

More information:
https://bugs.webkit.org/show_bug.cgi?id=140191

@diegoreymendez
Copy link
Contributor

I'm dissociating myself from this task for the time being, and until cookies-adding support for WKWebView comes out.

@diegoreymendez diegoreymendez removed their assignment Feb 17, 2016
@bummytime
Copy link
Member Author

Good work on this @diegoreymendez! We will keep our fingers crossed for real cookie support soon...

@diegoreymendez diegoreymendez removed this from the Future milestone Apr 14, 2016
@koke
Copy link
Member

koke commented Mar 31, 2017

Just leaving a note that the webkit bug was resolved a couple weeks ago, so hopefully it'll land on iOS 11

@nheagy
Copy link
Contributor

nheagy commented Jun 14, 2017

WKWebView now has a cookie managing API in iOS 11 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants