Android 中当我们在使用WebView加载html页面时,html中可能会嵌套iframe,这时候iframe里面的请求Android通过
shouldOverrideUrlLoading是无法拦截的,需要shouldInterceptRequest才可以拦截到。但是shouldInterceptRequest会
将所有请求拦截,比如.js\.css等等,这并不是我们想要的。
后来发现通过设置iframe内部页面的target可以实现将内部请求转发到shouldOverrideUrlLoading。具体如下:
在iframe内部的html的head中设置:<base target="_top">或<base target="_parent">即可