Comments (1)
在WKWebView中不会自动带上cookie。对于一般的业务场景,比如注入登录态,就需要业务侧主动将cookies注入到webview中。在框架中HPKWebView也提供了相对简单的Javascript方法封装,setCookieWithName & deleteCookiesWithName & getAllCustomCookiesName & deleteAllCustomCookies。我们可以将存储在NSHTTPCookieStorage中的cookies按照domain的关系取出然后注入到webview中。对于请求我们可以在对应的header中手动设置。当然对于iOS11+,系统也提供了WKHTTPCookieStore这个类,但是目前常用的App都需要支持更低的版本。
from hybridpagekit.
Related Issues (20)
- 内存警告处理不友好 HOT 5
- 请问下,如何设置webview的WKWebViewConfiguration在NestingWebViewController的使用方法里? HOT 1
- 前端页面通过JS滚动web的话,然后再次手势滑动,会有闪一下的效果,这个没考虑到 HOT 1
- WKWebView 高度问题 HOT 2
- 希望添加 WKWebViewExtension的调用支持 HOT 1
- 是否有支持swift计划 HOT 1
- 请问如何注入js方法到webview HOT 1
- 懒加载图片的时候注入加载图片的js HOT 1
- 有两个框架相关的问题咨询一下 HOT 1
- 给TableView添加tableHeaderView和FooterView可能会导致计算出现问题 HOT 2
- 私有api会有审核风险么 HOT 1
- 标题不能自适应高度
- 在默认缓存策略下,重用后的webView会忽略304缓存,每次都会重新获取主html
- 支持标签页控件吗? HOT 1
- 支持识别白屏吗
- Android端有类似的框架吗?
- 进入界面后定位到指定的Component
- 有类似的swift版本吗?
- 这个方法是私有方法么?会影响上架么?? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hybridpagekit.