Commit 30f3f0a
committed
fix(DefaultWebClient): allow file:// and javascript: navigations to fall through (#762)
Resolves #762
DefaultWebClient.shouldOverrideUrlLoading explicitly handles http/https,
then runs through phone/email/intent/wechat/alipay handlers, and finally
intercepts every remaining URL when mIsInterceptUnkownUrl is true (the
default). file:// links between bundled assets (the most common pattern
for offline H5 apps that hit this method) end up in that final branch,
which returns true and silently drops the navigation. The same is true
of javascript: URLs.
Two new scheme constants (FILE_SCHEME / JAVASCRIPT_SCHEME) are added
near SCHEME_SMS, and both overloads of shouldOverrideUrlLoading return
false as soon as they see one of those schemes, letting WebView handle
the navigation itself.1 parent 95d48cd commit 30f3f0a
1 file changed
Lines changed: 22 additions & 0 deletions
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
149 | 157 | | |
150 | 158 | | |
151 | 159 | | |
| |||
189 | 197 | | |
190 | 198 | | |
191 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
192 | 207 | | |
193 | 208 | | |
194 | 209 | | |
| |||
278 | 293 | | |
279 | 294 | | |
280 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
281 | 303 | | |
282 | 304 | | |
283 | 305 | | |
| |||
0 commit comments