Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Simulator shows 'about:blank' when scheme/hostname preferences are set #314

Closed
3 tasks done
cellcrowd opened this issue Jan 17, 2022 · 2 comments
Closed
3 tasks done

Comments

@cellcrowd
Copy link

cellcrowd commented Jan 17, 2022

Bug Report

Problem

When adding

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />

into the <platform name="ios"> section of config.xml, the iOS simulator shows "about:blank" page instead of "index.html" page

What is expected to happen?

App should display "index.html" page

What does actually happen?

App displays "about:blank" page

Information

This bug does not happen on real devices, only in the simulator

Command or Code

  • cordova create hello com.example.hello HelloWorld
  • cordova platform add ios
  • cordova emulate ios --target="iPhone-8-Plus, 15.2" (shows index.html)
  • added scheme/hostname preferences inside ios section as per above
  • cordova emulate ios --target="iPhone-8-Plus, 15.2" (shows about:blank)

Environment, Platform, Device

iOS Simulator on Mac OS Big Sur 11.6, Mac Mini (M1, 2020) 8GB

Version information

Cordova CLI 11.0.0
Cordova iOS 6.2.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@cellcrowd
Copy link
Author

When running document.location = 'app://index.html' through the Safari debugger, the page loads. However, it fails to load CSS with error: Did not parse stylesheet at 'app://index.html/css/index.css' because non CSS MIME types are not allowed in strict mode.

Running document.location = 'app://localhost' does the same as above with error: Did not parse stylesheet at 'app://localhost/css/index.css' because non CSS MIME types are not allowed in strict mode.

Running document.location = 'app://' shows 'about:blank'

Running document.location = 'app://localhost/index.html' does not do anything (returns "app://localhost/index.html" = $1 in console)

@cellcrowd
Copy link
Author

Closing the issue here in favour of the cordova-ios issue tracker, apache/cordova-ios#1215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant