ryan-shz / fastwebview Goto Github PK
View Code? Open in Web Editor NEW自定义本地缓存策略和资源加载策略,突破原生WebView缓存限制,实现多种缓存模式,支持离线加载和预加载,可大幅提升加载速度。
License: MIT License
自定义本地缓存策略和资源加载策略,突破原生WebView缓存限制,实现多种缓存模式,支持离线加载和预加载,可大幅提升加载速度。
License: MIT License
fastCookieManager.setRequestCookieInterceptor(new CookieInterceptor() { @Override public List<Cookie> newCookies(HttpUrl url, List<Cookie> originCookies) { for (Cookie cookie : originCookies) { Log.v(TAG, "request cookies: " + cookie.toString()); } return originCookies; } });
似乎没有正确工作。setResponseCookieInterceptor 拦截器倒是拦截了。
设置NORMAL或FORCE缓存模式视频无法播放,默认缓存模式可以播放
版主关于WebViewPool的代码可否先上传呀,想提前试用下。
在选中使用缓存池之后,进入webview加载完github后再点击任何一个git内的链接,然后点击返回键,崩溃
继承FastWebView时,注意构造方法 - defStyleAttr不能传0
public FastWebView(Context context, AttributeSet attrs) {
super(context, attrs, 0);
}
另外可能还需要你设置如下属性requestFocus()
1111111111
我们项目使用您的开源库之后,网页加载速度得到明显提升。感谢您,想请您喝杯咖啡,不知道方不方便提供一个收款码?
fastWebView.setCacheConfig(new CacheConfig.Builder()
.setCacheDir(String fileDir)
.setExtensionFilter(ExtensionFilter filter)
.setVersion(int version)
.setMemorySize(int size)
.setDiskCacheSize(long diskCacheSize)
.build());
不应该只初始化一次吗? 现在如果想要使用缓存,每次创建WebVIew都要这样设置吗?
你好,请问bintray-release 这个插件主要做了什么工作?
软键盘无法弹起
2020-06-14 22:43:35.560 25797-26208/ W/System.err: java.lang.IllegalArgumentException: statusCode can't be in the [300, 399] range.
2020-06-14 22:43:35.561 25797-26208/ W/System.err: at android.webkit.WebResourceResponse.setStatusCodeAndReasonPhrase(WebResourceResponse.java:135)
2020-06-14 22:43:35.561 25797-26208/ W/System.err: at android.webkit.WebResourceResponse.(WebResourceResponse.java:77)
2020-06-14 22:43:35.561 25797-26208/ W/System.err: at com.ryan.github.view.offline.DefaultWebResponseGenerator.generate(DefaultWebResponseGenerator.java:71)
2020-06-14 22:43:35.561 25797-26208/ W/System.err: at com.ryan.github.view.offline.OfflineServerImpl.get(OfflineServerImpl.java:66)
2020-06-14 22:43:35.561 25797-26208/ W/System.err: at com.ryan.github.view.WebViewCacheImpl.getResource(WebViewCacheImpl.java:50)
2020-06-14 22:43:35.562 25797-26208/ W/System.err: at com.ryan.github.view.InnerFastClient.loadFromWebViewCache(InnerFastClient.java:274)
2020-06-14 22:43:35.562 25797-26208/ W/System.err: at com.ryan.github.view.InnerFastClient.onIntercept(InnerFastClient.java:264)
2020-06-14 22:43:35.562 25797-26208/ W/System.err: at com.ryan.github.view.InnerFastClient.shouldInterceptRequest(InnerFastClient.java:245)
2020-06-14 22:43:35.562 25797-26208/ W/System.err: at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:79)
2020-06-14 22:43:35.562 25797-26208/ W/System.err: at org.chromium.android_webview.AwContents$BackgroundThreadClientImpl.shouldInterceptRequest(AwContents.java:9)
2020-06-14 22:43:35.563 25797-26208/ W/System.err: at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(AwContentsBackgroundThreadClient.java:11)
POST请求没有携带Cookie
如果设置缓存模式为FastCacheMode.FORCE,为什么要加一个DiskResourceInterceptor拦截器呢?直接加大okttp缓存大小不就可以了么?反正底层用的都是DiskLruCache的逻辑?
版主 请问你们的上线项目是啥 我下载了体验一下。
020-06-11 17:49:05.700 5293-5913 W/System.err: java.lang.IllegalArgumentException: reasonPhrase can't be empty.
2020-06-11 17:49:05.700 5293-5913 W/System.err: at android.webkit.WebResourceResponse.setStatusCodeAndReasonPhrase(WebResourceResponse.java:138)
2020-06-11 17:49:05.700 5293-5913 W/System.err: at android.webkit.WebResourceResponse.(WebResourceResponse.java:76)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at com.ryan.github.view.offline.DefaultWebResponseGenerator.generate(DefaultWebResponseGenerator.java:71)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at com.ryan.github.view.offline.OfflineServerImpl.get(OfflineServerImpl.java:66)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at com.ryan.github.view.WebViewCacheImpl.getResource(WebViewCacheImpl.java:50)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at com.ryan.github.view.InnerFastClient.loadFromWebViewCache(InnerFastClient.java:274)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at com.ryan.github.view.InnerFastClient.onIntercept(InnerFastClient.java:264)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at com.ryan.github.view.InnerFastClient.shouldInterceptRequest(InnerFastClient.java:245)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:52)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at org.chromium.android_webview.AwContents$BackgroundThreadClientImpl.shouldInterceptRequest(AwContents.java:9)
2020-06-11 17:49:05.701 5293-5913 W/System.err: at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(AwContentsBackgroundThreadClient.java:11)
cookie同步问题没法解决吗?okhttp和webview的cookie同步问题
不能缓存视频文件
RT
强制模式下清理缓存文件夹后需要重启app才能显示最新的页面,普通模式下清理完缓存文件夹就可以显示最新的页面,这是什么原因呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.