S Sjuanj Member May 31, 2023 #1 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: Code: 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: Code: 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
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: Code: 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: Code: 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