You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by rubenstolk <gi...@git.apache.org> on 2017/02/02 20:11:47 UTC

[GitHub] cordova-plugin-wkwebview-engine pull request #30: Allow XHR to file:// and a...

GitHub user rubenstolk opened a pull request:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30

    Allow XHR to file:// and allow local file (upload) handling

    I know this PR won't be merged but I wanted to submit it anyways for people who face the same issues and want a solution that works for at least iOS 9 + 10.
    
    (This PR replaces an earlier experimental version at https://github.com/apache/cordova-plugin-wkwebview-engine/pull/26)
    
    Until there is a better solution to setting this property, this solves the XHR and local file api issues.
    This issue is described further in https://bugs.webkit.org/show_bug.cgi?id=154916.
    
    ### Platforms affected
    - [x] iOS
    
    ### What does this PR do?
    - [x] Prevents "Security DOM 18 error" while manipulating files, such as handling file uploads
    - [x] Prevents "NetworkError (DOM Exception 19):  A network error occurred." while loading files through XHR from `file://`
    
    ### What testing has been done on this change?
    - [x] XHR and file handling (incl. reading using File api etc)
    - [x] Test on iOS 10
    - [x] Test on iOS 9

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/safetychanger/cordova-plugin-wkwebview-engine allow-file-access

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #30
    
----
commit 69b9787e5d847e9e8263a56963b8e4a72e8911a9
Author: Ruben Stolk <ru...@changer.nl>
Date:   2017-02-02T20:08:13Z

    Allow XHR to file:// and allow local file (upload) handling

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-wkwebview-engine issue #30: Allow XHR to file:// and allow lo...

Posted by rubenstolk <gi...@git.apache.org>.
Github user rubenstolk commented on the issue:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30
  
    Hey, looks great. Still didn't get time to convert this into a plugin...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-wkwebview-engine issue #30: Allow XHR to file:// and allow lo...

Posted by rubenstolk <gi...@git.apache.org>.
Github user rubenstolk commented on the issue:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30
  
    Hey really cool!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-wkwebview-engine issue #30: Allow XHR to file:// and allow lo...

Posted by TheMattRay <gi...@git.apache.org>.
Github user TheMattRay commented on the issue:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30
  
    Created plugin from your code samples and some testing:
    
    [](https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-wkwebview-engine issue #30: Allow XHR to file:// and allow lo...

Posted by cjpearson <gi...@git.apache.org>.
Github user cjpearson commented on the issue:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30
  
    @rubenstolk, you could try creating a plugin that swizzles `createConfigurationFromSettings` and adds your changes. Then anybody who wants this fix can just install your patch plugin and not have to worry about maintaining a local version of the wkwebview plugin.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-wkwebview-engine issue #30: Allow XHR to file:// and allow lo...

Posted by rubenstolk <gi...@git.apache.org>.
Github user rubenstolk commented on the issue:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30
  
    @cjpearson Good idea, for that we need to have some kind of hook in the regular `createConfigurationFromSettings` implementation. I'm not really into Objective C so not sure if I'll do this any time soon but if you have ideas then we could collaborate...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-wkwebview-engine pull request #30: Allow XHR to file:// and a...

Posted by rubenstolk <gi...@git.apache.org>.
Github user rubenstolk closed the pull request at:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-wkwebview-engine issue #30: Allow XHR to file:// and allow lo...

Posted by cordova-qa <gi...@git.apache.org>.
Github user cordova-qa commented on the issue:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30
  
    Cordova CI Build has completed successfully.
    
    **Commit**     - [Link](https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30/commits/69b9787e5d847e9e8263a56963b8e4a72e8911a9)
    **Dashboard** - [Link](http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-wkwebview-engine-pr/2/)
    
     2 tests run, 0 skipped, 0 failed.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-wkwebview-engine issue #30: Allow XHR to file:// and allow lo...

Posted by cjpearson <gi...@git.apache.org>.
Github user cjpearson commented on the issue:

    https://github.com/apache/cordova-plugin-wkwebview-engine/pull/30
  
    I think something like [this](https://gist.github.com/cjpearson/ae2a1c12e4737549721ec3c04e617789) should work. You can add the files to your Xcode project or create a plugin that includes them as source files. `load` will automatically be called so you don't need to invoke anything.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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