tuarua / WebViewANE

WebView Adobe Air Native Extension for macOS 10.10+, Windows Desktop, iOS 9.0+ and Android 19+. This ANE provides access to a more modern webview from AIR.
Apache License 2.0
183 stars 53 forks source link

Invalid URI Error when loading an unreachable URL without specifying URI scheme #262

Closed esidegallery closed 4 years ago

esidegallery commented 4 years ago

Answer the below. DO NOT DELETE!!

tuarua commented 4 years ago

Any url checking/cleaning should be done in your client.

Chromium is rejecting the url and throwing up the error you see above. It's important to remember other browsers are an app+WebView. The ANE is not a browser, but a wrapper around a WebView.

I am unable to do this inside the ANE as I can't assume the prefix eg localhost might want to be http:// web urls might want to be https://

Before passing a url to load you could do

if !url.startsWith(https://) {
  url = https:// + url
}