Open m-abs opened 4 years ago
I'm having a problem with loading data from x-local
with the contents of my webview being loaded from file://
.
And the x-local
load fails silently, neither onload
nor onerror
of the XmlHttpRequest
seem to get called.
Is this the same error?
Directly loading the data with file://
from a subfolder of knownFolders.documents()
also didn't work
Edit: onreadystatechange()
does work, so not the same problem.
Edit2: fetch()
does not work
WKWebView
considers the x-local scheme insecure, when the page is loaded via HTTPS and refuses to load local files viax-local
.Workaround: Use
autoLoadJavaScriptFile
orautoLoadStyleSheetFile
before loading the webpage. This will generate at WKUserScript that doesn't have the same restrictions.Alternativ for javascript files.
Alternative for CSS files.
No known workaround for other filetypes.
I'm working on a solution, but I cannot promise when I can have it solved.