Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/providers/image-loader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';
import { DirectoryEntry, File, FileEntry, FileError } from '@ionic-native/file';
import { HttpClient } from '@angular/common/http';
import { normalizeUrl } from 'ionic-angular';
import { ImageLoaderConfig } from "./image-loader-config";
import { Platform } from 'ionic-angular';
import { Observable } from 'rxjs/Observable';
Expand Down Expand Up @@ -452,8 +453,8 @@ export class ImageLoader {
// therefore the file needs to be copied into that directory first!
if (this.isIonicWKWebView) {

// Ionic WKWebView can access all files, but we just need to replace file:/// with http://localhost:8080/
resolve(fileEntry.nativeURL.replace('file:///', 'http://localhost:8080/'));
// Use Ionic normalizeUrl to generate the right URL for Ionic WKWebView
resolve(normalizeUrl(fileEntry.nativeURL));

} else if (this.isWKWebView) {

Expand Down