File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -499,6 +499,11 @@ var Config = new Class({
499
499
*/
500
500
this . loaderImageLoadType = GetValue ( config , 'loader.imageLoadType' , 'XHR' ) ;
501
501
502
+ /**
503
+ * @const {string} Phaser.Core.Config#loaderLocalScheme - Optional local scheme definition.
504
+ */
505
+ this . loaderLocalScheme = GetValue ( config , 'loader.localScheme' , '' ) ;
506
+
502
507
/*
503
508
* Allows `plugins` property to either be an array, in which case it just replaces
504
509
* the default plugins like previously, or a config object.
Original file line number Diff line number Diff line change 11
11
* @property {string } [user] - Optional username for all XHR requests.
12
12
* @property {string } [password] - Optional password for all XHR requests.
13
13
* @property {number } [timeout=0] - Optional XHR timeout value, in ms.
14
+ * @property {string } [localScheme] - Optional local scheme definition.
14
15
*/
Original file line number Diff line number Diff line change @@ -318,7 +318,8 @@ var File = new Class({
318
318
// On iOS, Capacitor often runs on a capacitor:// protocol, meaning local files are served from capacitor:// rather than file://
319
319
// See: https://github.com/photonstorm/phaser/issues/5685
320
320
321
- var isLocalFile = xhr . responseURL && ( xhr . responseURL . indexOf ( 'file://' ) === 0 || xhr . responseURL . indexOf ( 'capacitor://' ) === 0 ) ;
321
+ var localSchemes = [ 'file://' , 'capacitor://' , this . loader . systems . game . config . loaderLocalScheme ] ;
322
+ var isLocalFile = xhr . responseURL && localSchemes . some ( function ( scheme ) { return xhr . responseURL . indexOf ( scheme ) === 0 ; } ) ;
322
323
323
324
var localFileOk = ( isLocalFile && event . target . status === 0 ) ;
324
325
You can’t perform that action at this time.
0 commit comments