ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 217 forks source link

ionic webview v4 changes things again... #491

Closed captaincaius closed 4 years ago

captaincaius commented 5 years ago

I'm submitting a...

Current behavior

ionic webview 4 changes quite a few things about the origin:

  1. no port 8081 anymore - on android it's http://localhost
  2. on ios, the origin's scheme is ionic:// by default, but due to integrating with some google services, it's a good idea to override it to httpsionic:// instead (you can see some issues in their queue for details)

Expected behavior

Necessary: update the index.html cordova monkeypatch accordingly - I'm now using this:

if(/^localhost/.test(location.host) & !/^localhost:/.test(location.host)) {
  // ...
}

Optional: iosScheme to httpsionic and update whitelist stuff accordingly

Minimal reproduction of the problem with instructions

Environment




Others:

sinedied commented 5 years ago

Is it broken with the current version? Or do we need to upgrade + fix?

captaincaius commented 5 years ago

well right now the regex in index.html doesn't match the actual scheme/host: https://github.com/ngx-rocket/generator-ngx-rocket/blob/master/generators/app/templates/src/_index.html#L59 because the configuration we have has it set to the defaults, which is ionic://localhost for ios and http://localhost for android.

Whether it's "broken" or not, I'm not sure, because I haven't actually reproduced the bug that necessitates this fix since a long while ago. But I can't imagine it walked away on its own.

So the two options are:

  1. Fix that line in index.html to match our current configuration
  2. First change the configuration slightly to make ios httpsionic://localhost and change index.html to match THAT (using the pattern I posted above).

Although #2 is a little more heavy-handed, it's a little safer for integrations (see https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/283 for example)

captaincaius commented 5 years ago

Okay looks like I was wrong :D ... I didn't see the updates to config.xml.

It's currently NOT broken - index.html matches config.xml ... so with that in mind, changing the configuration for easier integration with other services is all that's left, which isn't something critical since not all users will need to do that.

sinedied commented 4 years ago

:tada: This issue has been resolved in version 8.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: