title: Change origin of WKWebView in iOS app
body: <p>I have an iOS hybrid app centred around a <code>WKWebView</code> loading local web assets with <a href="https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKWebView_Ref/#//apple_ref/occ/instm/WKWebView/loadFileURL:allowingReadAccessToURL:"><code>loadFileURL</code></a>. The <code>WKWebView</code> communicates over HTTPS to a backend API with <code>jQuery.ajax</code>. The app is mobile-only and I want the API to also be "mobile-only". That is, I want to block browsers such as Chrome and Firefox from using the API.</p>
  
  <p>My strategy is to set the <code>Access-Control-Allow-Origin</code> header on API responses as follows:</p>
  
  <pre><code>Access-Control-Allow-Origin: app://myApp
  </code></pre>
  
  <p>Can I change the origin of the <code>WKWebView</code> to <code>app://myApp</code> to avoid browsers from querying the API?</p>