ios - Always load // protocol as http://, not file:// -
in app, load local files file:// protocol in uiwebview. load several http:// protocol resources in files, in turn load other resources, rather using specific protocol relying on // protocol (protocol relative url) use appropriate protocol, should either http:// or https://, ends being file://in case.
i have been tinkering around while now, trying replace // links http:// through javascript, unsuccessfully, , i'm pretty lost. can't change code requests // links, , ios/webkit automatically assumes file:// right protocol use.
is there way around this, making ios use http:// in place of //, or other way work?
after looking on again, realised didn't need use file-protocol @ – html local file, input uiwebview using loadhtmlstring: baseurl:, , set baseurl http://domain.com. way, protocol used http.
this solution did involve quite tinkering webview:shouldstartloadwithrequest:navigationtype: , back/forward history changes, nothing compared trying change protocols.
if has other solutions, i'm interested see them!
Comments
Post a Comment