Skip to content

Commit 9760822

Browse files
authored
replace startsWith with indexOf (#497)
Fix Android 5 convertFileSrc not working issue
1 parent d93f4e4 commit 9760822

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/www/util.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ var WebView = {
55
if (!url) {
66
return url;
77
}
8-
if (url.startsWith('/')) {
8+
if (url.indexOf('/')===0) {
99
return window.WEBVIEW_SERVER_URL + '/_app_file_' + url;
1010
}
11-
if (url.startsWith('file://')) {
11+
if (url.indexOf('file://')===0) {
1212
return window.WEBVIEW_SERVER_URL + url.replace('file://', '/_app_file_');
1313
}
14-
if (url.startsWith('content://')) {
14+
if (url.indexOf('content://')===0) {
1515
return window.WEBVIEW_SERVER_URL + url.replace('content:/', '/_app_content_');
1616
}
1717
return url;
@@ -27,4 +27,4 @@ var WebView = {
2727
}
2828
}
2929

30-
module.exports = WebView;
30+
module.exports = WebView;

0 commit comments

Comments
 (0)