All Projects → wilddylan → Wkwebviewwithurlprotocol

wilddylan / Wkwebviewwithurlprotocol

Licence: mit
WKWebView With URLProtocol

Labels

Projects that are alternatives of or similar to Wkwebviewwithurlprotocol

Kkjsbridge
一站式解决 WKWebView 支持离线包,Ajax/Fetch 请求,表单请求和 Cookie 同步的问题 (基于 Ajax Hook,Fetch Hook 和 Cookie Hook)
Stars: ✭ 462 (+165.52%)
Mutual labels:  wkwebview
Youtubeplayerview
Helper library for iOS developers that want to embed YouTube videos in their iOS apps with the iframe player API. 📹
Stars: ✭ 72 (-58.62%)
Mutual labels:  wkwebview
Flwebview
WKWebView with UIWebView fallback for iOS.
Stars: ✭ 145 (-16.67%)
Mutual labels:  wkwebview
Jxbwkwebview
An component WebView for iOS base on WKWebView
Stars: ✭ 646 (+271.26%)
Mutual labels:  wkwebview
Hybridpagekit
A high-performance、high-extensibility、easy integration framework for Hybrid content page. Support most content page types of News App.
Stars: ✭ 1,101 (+532.76%)
Mutual labels:  wkwebview
Flutter browser app
A Full-Featured Mobile Browser App (such as the Google Chrome mobile browser) created using Flutter and the features offered by the flutter_inappwebview plugin.
Stars: ✭ 85 (-51.15%)
Mutual labels:  wkwebview
Marionette
🧸 Swift library which provides a high-level API to control a WKWebView
Stars: ✭ 374 (+114.94%)
Mutual labels:  wkwebview
Pawebview
An component WebView for iOS base on WKWebView
Stars: ✭ 169 (-2.87%)
Mutual labels:  wkwebview
Reusablenestingscrollview
An scrollView handler for UIScrollView & WKWebView and other scrollViews. Providing scrollview`s subViews reusable.
Stars: ✭ 61 (-64.94%)
Mutual labels:  wkwebview
Lcwebview
www.strictfrog.com
Stars: ✭ 144 (-17.24%)
Mutual labels:  wkwebview
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (+307.47%)
Mutual labels:  wkwebview
Wkwebviewjavascriptbridge
🌉 A Bridge for Sending Messages between Swift and JavaScript in WKWebViews.
Stars: ✭ 863 (+395.98%)
Mutual labels:  wkwebview
Mybrowser
我的浏览器,基于WKWebView实现的一个iOS浏览器,实现了无图模式、广告拦截、多窗口、扫描二维码、收藏夹/历史、无痕浏览、夜间模式等功能...
Stars: ✭ 127 (-27.01%)
Mutual labels:  wkwebview
React Native Wkwebview
WKWebview Component for React Native
Stars: ✭ 622 (+257.47%)
Mutual labels:  wkwebview
Applemusicultra
Music Client for macOS. Upgrade your music experience with themes, styles, custom scripting and more. Uses WebKit and JavaScript.
Stars: ✭ 155 (-10.92%)
Mutual labels:  wkwebview
Xwebview
An extensible WebView for iOS (based on WKWebView)
Stars: ✭ 442 (+154.02%)
Mutual labels:  wkwebview
Flutter inappwebview
A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
Stars: ✭ 1,259 (+623.56%)
Mutual labels:  wkwebview
Wkcookiewebview
WKWebView with cookie sharing support
Stars: ✭ 171 (-1.72%)
Mutual labels:  wkwebview
Swiftui Webview
A SwiftUI component to use WKWebView
Stars: ✭ 158 (-9.2%)
Mutual labels:  wkwebview
Ionic Native Http Connection Backend
A solution to CORS issues with Ionic and iOS
Stars: ✭ 142 (-18.39%)
Mutual labels:  wkwebview

WKWebViewWithURLProtocol

:Warning:

Note:If you target iOS 11, you can now use WKURLSchemeHandler to avoid this trick! 😆

introductions

MIT Licence

After iOS8.0, WKWebView want to instead of UIWebView, but with some defects such as: URLProtocol can't process the request from WKWebView. WKWebViewWithURLProtocol want to fix this use runtime. Now-coming!

But Notice, WKWebView ignored HTTP Body in request, it's a bug, resolve with Javascript bridge or NSURLSession.

[NSURLProtocol wk_registerScheme:@"http"];
[NSURLProtocol wk_registerScheme:@"https"];

[NSURLProtocol registerClass:[URLProtocol class]];

URLProtocol is the subclass of NSURLProtocol, before this, use wk_registerScheme to let URLProtocol known what scheme can be hooked from WKWebView. Now this demo want to hook http and https scheme.

[_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.devdylan.cn"]]];

Now, open your custom URLProtocol, set some breakpoint or logs, oh my god! it's worked!

Notes: It's only useful when systemVersion > iOS8.4

Some questions:

Q: Used private API when in review:

A: Watch this issue

Installation
pod "WKWebViewWithURLProtocol"
Author

Dylan, [email protected]

Thanks

@yeatse, Original repo without cocoapods

License

MIT License.

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].