1

From 2 years I was using BrowserComponent to display html code and Browser Navigation Callback to catch url changes. In the past, all things worked fine but currently, there are some issues that I'm facing.

First one: isuess during redirect to a url from html page:

The webpage at
 http://yallagym.herokuapp.com/payment/callback/accepted could not be loaded because:
net::ERR_CLEARTEXT_NOT_PERMITTED

Second issue: Unable to load html page and white page appears:

[EDT] 0:0:23,863 - Codename One revisions: 7dd4e7d08b3442d90959477ee52a5ae8c4361b29
[EDT] 0:0:23,864 - Attempting to create browser component
[AWT-EventQueue-0] 0:0:23,868 - Attempting to create browser component
Using:
JCEF Version = 83.4.0.260
CEF Version = 83.4.0
Chromium Version = 83.0.4103.106
initialize on Thread[AWT-EventQueue-0,6,main] with library path C:\Users\fuad-\.codenameone\cef\lib\win64
Added scheme search://
Added scheme client://
Added scheme cn1stream://
DevTools listening on ws://127.0.0.1:56645/devtools/browser/0f082d24-9bc9-4a81-b652-7960d4b4e947
AppHandler.stateHasChanged: NEW
AppHandler.stateHasChanged: INITIALIZING
AppHandler.stateHasChanged: INITIALIZED
url:https://cn1app/streams/1
Stream was closed

for first issue I found this build hint could be help

android.xapplication_attr=android:usesCleartextTraffic="true"

For the secound issue I did not find any solution.

  • I would recommend using HTTPS and not using the [workaround you mentioned](https://stackoverflow.com/questions/57121953/usescleartexttraffic-not-permitted). Can you provide a bit more detail about what feature you're using in the `BrowserComponent` that connects to `https://cn1app/streams/1` ? – Shai Almog Nov 08 '22 at 04:01
  • Thanks mr Shai Almog, i got this error from output [1121/204535.535:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at https://atfawry.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032." – Fuad Nassar Nov 22 '22 at 18:46
  • and after contact atfawry support they say "Kindly note that the cookies is not related to fawry side as it is a setting to be enabled from the browser itself. Kindly enable it to bypass this error or check for a solution with the browser itself." – Fuad Nassar Nov 22 '22 at 18:48
  • That doesn't look like the cause of the issue. Are there no other errors in the chrome console? If not can you please elaborate on the stream that's closed and where you see that error exactly? – Shai Almog Nov 23 '22 at 04:49
  • No. However, SameSite attribute caused the page to fail to load, how i can enabled cookies in BrowserComponent? – Fuad Nassar Nov 23 '22 at 21:52
  • Cookies are enabled. This is a change in Chrome related to the way cookies are handled to block privacy abuse. – Shai Almog Nov 24 '22 at 03:39

0 Answers0