B4J Question Webview and CORS

Sjuanj

Member
Hello everyone
(Sorry for my English, I'm using the translator)

I am creating an application that is basically a browser, all it does is load a page with a video player.
I have done this project in b4a and it works fine, I just had to add:

B4X:
    Dim jo As JavaObject = WebView1
    Dim settings As JavaObject = jo.RunMethod("getSettings", Null)
    Dim r As Reflector
    r.Target = settings
    r.RunMethod2("setAllowUniversalAccessFromFileURLs", True, "java.lang.boolean")

But b4j doesn't have that option, and no matter how much I've searched for any similar one. The javafx seems to work by adding:

System.setProperty("sun.net.http.allowRestrictedHeaders", "true");

I add it as follows:

B4X:
SetSystemProperty("sun.net.http.allowRestrictedHeaders", "true")

But it keeps giving me the same error. The error is due to CORS (cross-origin resource sharing), in browsers it gives me the same problem if I don't disable CORS.
Can anybody help me?
Thank you so much
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…