File tree Expand file tree Collapse file tree 4 files changed +6
-10
lines changed Expand file tree Collapse file tree 4 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import { CoreIframeUtilsProvider } from '@providers/utils/iframe';
2525import { CoreUtilsProvider } from '@providers/utils/utils' ;
2626import { CoreSplitViewComponent } from '@components/split-view/split-view' ;
2727import { CoreUrl } from '@singletons/url' ;
28- import { WKWebViewCookiesWindow } from 'cordova-plugin-wkwebview-cookies' ;
2928
3029@Component ( {
3130 selector : 'core-iframe' ,
@@ -102,7 +101,7 @@ export class CoreIframeComponent implements OnInit, OnChanges {
102101 if ( this . platform . is ( 'ios' ) && ! this . urlUtils . isLocalFileUrl ( url ) ) {
103102 // Save a "fake" cookie for the iframe's domain to fix a bug in WKWebView.
104103 try {
105- const win = < WKWebViewCookiesWindow > window ;
104+ const win = < any > window ;
106105 const urlParts = CoreUrl . parse ( url ) ;
107106
108107 await win . WKWebViewCookies . setCookie ( {
Original file line number Diff line number Diff line change @@ -1251,7 +1251,7 @@ export class CoreFileProvider {
12511251 * @return Converted src.
12521252 */
12531253 convertFileSrc ( src : string ) : string {
1254- return this . appProvider . isMobile ( ) ? ( < any > window ) . Ionic . WebView . convertFileSrc ( src ) : src ;
1254+ return this . appProvider . isIOS ( ) ? ( < any > window ) . Ionic . WebView . convertFileSrc ( src ) : src ;
12551255 }
12561256
12571257 /**
@@ -1261,13 +1261,11 @@ export class CoreFileProvider {
12611261 * @return Unconverted src.
12621262 */
12631263 unconvertFileSrc ( src : string ) : string {
1264- if ( ! this . appProvider . isMobile ( ) ) {
1264+ if ( ! this . appProvider . isIOS ( ) ) {
12651265 return src ;
12661266 }
12671267
1268- const scheme = this . platform . is ( 'ios' ) ? CoreConfigConstants . ioswebviewscheme : 'http' ;
1269-
1270- return src . replace ( scheme + '://localhost/_app_file_' , 'file://' ) ;
1268+ return src . replace ( CoreConfigConstants . ioswebviewscheme + '://localhost/_app_file_' , 'file://' ) ;
12711269 }
12721270}
12731271
Original file line number Diff line number Diff line change @@ -453,8 +453,7 @@ export class CoreUrlUtilsProvider {
453453 return scheme == 'cdvfile' ||
454454 scheme == 'file' ||
455455 scheme == 'filesystem' ||
456- scheme == CoreConfigConstants . ioswebviewscheme ||
457- ( scheme == 'http' && domain == 'localhost' ) ;
456+ scheme == CoreConfigConstants . ioswebviewscheme ;
458457 }
459458
460459 /**
Original file line number Diff line number Diff line change @@ -978,7 +978,7 @@ export class CoreWSProvider {
978978 options . responseType = options . responseType || 'json' ;
979979 options . timeout = typeof options . timeout == 'undefined' ? this . getRequestTimeout ( ) : options . timeout ;
980980
981- if ( this . appProvider . isMobile ( ) ) {
981+ if ( this . appProvider . isIOS ( ) ) {
982982 // Use the cordova plugin.
983983 if ( url . indexOf ( 'file://' ) === 0 ) {
984984 // We cannot load local files using the http native plugin. Use file provider instead.
You can’t perform that action at this time.
0 commit comments