I’m using the latest cordova-plugin-ionic-webview and now images loaded from external urls are not being loaded. Does anyone know what configuration I’m missing?
For instance, my images urls will be something like: http://myserver.com/img.png
and the code to display it:
HMTL
<ion-row class="image">
<img src="{{img_path}}" /> //img_path contains "http://myserver.com/img.png"
</ion-row>
TS
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
...
export class MyPage {
img_path: SafeUrl;
constructor(private sanitizer: DomSanitizer){
set_img_path(img_server_url){
const win: any = window;
this. img_path = this.sanitizer.bypassSecurityTrustUrl(win.Ionic.WebView.convertFileSrc(img_server_url));
}
}
}
Ionic info:
@ionic/cli-utils : 1.19.3
ionic (Ionic CLI) : 3.20.1
cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
@ionic/app-scripts : 3.2.1
Cordova Platforms : android 8.0.0 ios 5.0.1
Ionic Framework : ionic-angular 3.9.2
Node : v10.15.1
npm : 6.4.1
cordova-plugin-ionic-webview 4.1.2
Thanks