Skip to content

Commit

Permalink
replace startsWith with indexOf (#497)
Browse files Browse the repository at this point in the history
Fix Android 5 convertFileSrc not working issue
  • Loading branch information
l9c authored Mar 25, 2020
1 parent d93f4e4 commit 9760822
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/www/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ var WebView = {
if (!url) {
return url;
}
if (url.startsWith('/')) {
if (url.indexOf('/')===0) {
return window.WEBVIEW_SERVER_URL + '/_app_file_' + url;
}
if (url.startsWith('file://')) {
if (url.indexOf('file://')===0) {
return window.WEBVIEW_SERVER_URL + url.replace('file://', '/_app_file_');
}
if (url.startsWith('content://')) {
if (url.indexOf('content://')===0) {
return window.WEBVIEW_SERVER_URL + url.replace('content:/', '/_app_content_');
}
return url;
Expand All @@ -27,4 +27,4 @@ var WebView = {
}
}

module.exports = WebView;
module.exports = WebView;

0 comments on commit 9760822

Please sign in to comment.