Skip to content

react-native-webview 基于 5.12.0 版本调整,在 com.reactnativecommunity.webview.RNCWebViewManager.RNCWebView 中添加了 shouldInterceptRequest,用于拦截 http:https://android_image ,支持 webview 加载服务端 html 中 <img> 使用本地路径

License

Notifications You must be signed in to change notification settings

watch-the-fun/react-native-webview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-webview

react-native-webview 基于 5.12.0 版本调整,在 com.reactnativecommunity.webview.RNCWebViewManager.RNCWebView 中添加了 shouldInterceptRequest,用于拦截 http:https://android_image ,支持 webview 加载服务端 html 中 <img> 使用本地路径,目前支持 jpeg、jpg、png、svg、gif 扩展名的图片加载

使用方法,假定图片路径在设备上的绝对路径为 /data/user/0/com.example.app/cache/test.jpg , 在 html 代码中使用如下方式引用

<html>
<body>
  <img src="http:https://android_image/data/user/0/com.example.app/cache/test.jpg" />
</body>
</html>

使用 webview 加载该页面时便可以正常访问图片

About

react-native-webview 基于 5.12.0 版本调整,在 com.reactnativecommunity.webview.RNCWebViewManager.RNCWebView 中添加了 shouldInterceptRequest,用于拦截 http:https://android_image ,支持 webview 加载服务端 html 中 <img> 使用本地路径

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published