Window.refresh opens seperate browser window httpd


#1

I had this issue in the past, but I’m seeing it again, basically I have the httpd with https and it works just fine, however when I use window.refresh on android it opens a new window going to

https://localhost:8081 etc. not reloading the actual page itself.

I have the certs and everything and oddly enough it works with safari. I have added it to the trusted URLs and everything…

Thanks!


#2

I don’t think Google have any plans to fix this:

https://bugs.chromium.org/p/chromium/issues/detail?id=327728

That said, can you see what your app logs are saying and post it if anything informative is showing up in them?


#3

Its odd, because it worked in CrossWalk before and the article talks about kit-kat… Anyhow when it does do it, I get some message like ‘Passing request to another application’

It’s not that bug a deal, I can clear things out in a different I guess


#4

That actually sounds more like a bug with our whitelist checks :slight_smile:

If you can get me that log output I’ll take a look and see if I can reproduce it on my side.

Also just to double-check, this is on Crosswalk right, not Android?


#5

Hey Antoine,

This is actually using Android, not Crosswalk (Crosswalk is no longer supported! JK ) anyhow you can reproduce fairly easily.

Just create a simple project, do a timeout for like 5 seconds and have it run a window.loacation.reload or refresh and it will open it in a new browser, not the screen your on.

I’m not sure if its because the httpd https stuff or something with Android.


#6

So oddly enough now it appears that IOS, on launch now with httpds enabled jumps out to safari on load. I have added the URLs to the whitelist etc but yah, seems to open the browser window and not load up the app


#7

I’m having difficulty reproducing this here on Android 9 or iOS 12.2.

I have a new project serving content via https:// with the following being the only content in main.js:

setTimeout(function () {
    forge.logging.log("reloading page content");
    window.location.reload();
}, 5000);

Log output is:

[   INFO] 04-15 09:24:16.248 15152 15152 I Forge   : Application in focus, resuming webview.
[   INFO] 04-15 09:24:16.303 15152 15152 D Forge   : [FORGE WebView] Trusting self-signed certificate for localhost
[   INFO] 04-15 09:24:16.474 15152 15152 D Forge   : Returned: {"event":"internal.connectionStateChange","params":{"connected":true,"wifi":true}}
[   INFO] 04-15 09:24:19.282 15152 15230 I Forge   : Checking for reload update.
[   INFO] 04-15 09:24:20.873 15152 15230 I Forge   : No reload update available.
[   INFO] 04-15 09:24:21.521 15152 15152 I Forge   : Webview switching to whitelisted URL: https://localhost:31337/src/index.html
[   INFO] 04-15 09:24:26.723 15152 15272 I Forge   : [FORGE] 'reloading page content'
[   INFO] 04-15 09:24:26.727 15152 15152 I Forge   : Webview switching to whitelisted URL: https://localhost:31337/src/index.html

My own src/config.json is the same as the one posted at:

Can you please post your src/config.json and log outputs from forge run android -v and forge run ios -v ?


#8

So oddly enough now it appears that IOS, on launch now with httpds enabled jumps out to safari on load. I have added the URLs to the whitelist etc but yah, seems to open the browser window and not load up the app

Yep. I’m about ready to toss this laptop through this coffee shop window, even though it’s not the poor Macbook Pro’s fault. So frustrating.

I’m doing some fairly small but critical updates for quick release, and no idea how to resolve this. :frowning:


#9

So from what I can tell, IOS does not require https for httpd so you can remove that and it should be ok… google on the ot her hand requires it to work with Android (I miss you crosswalk :slight_smile: )

For me, I am able to get around most of this by just changing a small section of code… I would usually just do a ‘window.refresh’ to reset some paramas, but now I need to clear and reset manually vs a page refresh.


#10

Yeah, sorry if it seemed I was drama-queening it. Coming back to Trigger after working in native code the last year or so, and only needing to perform a small update, ending up having everything launching in an external browser, AND not being able to even connect the debugger, I was ready to do a marathon rewrite in native iOS and leave my Android customers on the old version (this app is stupid simple - like, I can not overstate how basic it is - and I can write it in Swift in a long weekend). But clearly, doing it in the existing platform is the 100% preferred method, so I want to just make stuff work :slight_smile:

I got the page stuff working, thankfully, and am concentrating on the debugging while finishing these UIX updates. * thumbs up *