项目作者: GEDYSIntraWare

项目描述 :
Plugin to proxy requests on iOS
高级语言: Objective-C
项目地址: git://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy.git
创建时间: 2020-11-24T16:30:30Z
项目社区:https://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy

开源协议:MIT License

下载


cordova-plugin-webview-proxy

Work in progress plugin.

With this plugin you can do requests to remote servers just like you would do normally. Cookies and CORS restrictions don’t apply here because the requests is performed by native code.

You just need to change the URL:

  1. const response = await fetch(window.WebviewProxy.convertProxyUrl(url));
  2. console.debug(response);

To delete all Cookies use this:

  1. window.WebviewProxy.clearCookie();

Make sure you are using a custom scheme with your iOS platform

This plugin uses the WKURLSchemeHandler provided by WKWebView. It requires the latest version of cordova-ios.

You enable the custom scheme by setting these preferences in config.xml

  1. <preference name="scheme" value="app" ></preference>
  2. <preference name="hostname" value="testapp"></preference>

Testing this plugin

This test app with custom pages and a simple backend is helpful for testing and developing this plugin.