You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jim Trainor (JIRA)" <ji...@apache.org> on 2016/03/08 15:45:40 UTC

[jira] [Comment Edited] (CB-10109) Allow WKWebView to proxy file:// url loading in XmlHttpRequest.open

    [ https://issues.apache.org/jira/browse/CB-10109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15184983#comment-15184983 ] 

Jim Trainor edited comment on CB-10109 at 3/8/16 2:44 PM:
----------------------------------------------------------

As reported by another commenter: a Polymer app won't load because it performs an XHR request to file:.  A resolution to this issue would help.

I tested wkwebview-engine-localhost and my polymer app does load using that plugin (which is a combination of this plugin plus a local web server). 

Note that wkwebview-engine-localhost introduce new problems with CORS requests. I haven't figured out if there is anyway to set a CORS header on the cordova-labs-local-webserver that  wkwebview-engine-localhost  uses. If there is a way to set a CORS header it is not obvious or well documented.


was (Author: jptrainor):
A reported by another commenter: a Polymer app won't load because it performs an XHR request to file:.  A resolution to this issue would help.

I tested wkwebview-engine-localhost and my polymer app does load using that plugin (which is a combination of this plugin plus a local web server). 

Note that wkwebview-engine-localhost introduce new problems with CORS requests. I haven't figured out if there is anyway to set a CORS header on the cordova-labs-local-webserver that  wkwebview-engine-localhost  uses. If there is a way to set a CORS header it is not obvious or well documented.

> Allow WKWebView to proxy file:// url loading in XmlHttpRequest.open
> -------------------------------------------------------------------
>
>                 Key: CB-10109
>                 URL: https://issues.apache.org/jira/browse/CB-10109
>             Project: Apache Cordova
>          Issue Type: Wish
>          Components: Plugin WKWebViewEngine
>            Reporter: Shazron Abdullah
>              Labels: wkwebview-known-issues
>
> Because of CORS, you can only open requests using http*:// schemes, not file.
> Ultimately this might be a new plugin. The plugin needs to:
> 1. Run a local webserver 
> 2. Proxy XmlHttpRequest.open and rewrite urls that go to (1) 
> The local webserver in (1) will route the requests using the appropriate handler, and will need to utilize a secret to prevent unauthorized access.
> Something like this: https://github.com/phonegap/connect-phonegap/blob/master/res/middleware/proxy.js



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org