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

Application does not initialize correctly on 10.x nightly/dev master #1217

Closed
3 tasks done
breautek opened this issue Apr 24, 2021 · 2 comments · Fixed by #1275
Closed
3 tasks done

Application does not initialize correctly on 10.x nightly/dev master #1217

breautek opened this issue Apr 24, 2021 · 2 comments · Fixed by #1275
Labels
Milestone

Comments

@breautek
Copy link
Contributor

breautek commented Apr 24, 2021

Bug Report

Problem

What is expected to happen?

Application to start correctly

What does actually happen?

Application fails to initialize probably (deviceReady not fired).

Information

This is a regression from a newly added feature #1137

With the default configuration, plugins will fail to initialise because they do not pass the whitelist checks. This occurs when you have at least one plugin installed.

The default <content src="index.html" /> seems to produce a white list pattern where index.html is the host, instead of the path, so when comparing against the https://localhost origin, it returns false.

Screenshot from 2021-04-24 12-36-24

Command or Code

cordova create test
cd test
cordova platform add android@nightly
cordova plugin add cordova-plugin-file
cordova run android

These steps will produce the hello world cordova app that stays on "connecting" because deviceReady never fires.

Environment, Platform, Device

cordova-android@nightly
And one other plugin

Version information

Workaround

Setting <content src="https://localhost/index.html" /> will correct the problem, but the framework should perhaps figure out this out so that <content src="index.html" /> continues to work properly.

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@breautek breautek added the bug label Apr 24, 2021
@breautek breautek added this to the 10.0.0 milestone Apr 24, 2021
@breautek breautek changed the title Application does not initialize correctly on nightly/dev master Application does not initialize correctly on 10.x nightly/dev master Apr 25, 2021
@jcesarmobile
Copy link
Member

It also works if you add <allow-navigation href="https://localhost/*" />, but yeah, it should work without the need of adding it or changing the content url.
I think the proper place to put it is inside the AllowList plugin, once it gets merged #1138
there is the check that allows the content src url

@NiklasMerz
Copy link
Member

Looks like we need to change this:

allowedNavigations.addAllowListEntry(startPage, false);

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

Successfully merging a pull request may close this issue.

3 participants